0
votes

I have json data like this

var data=    {
        'A' : {
            'Total' : 123,
            'Cricket' : 76,
            'Football' : 12,
            'Hockey' : 1,
            'None' : 10

        },
    'B' : {
        'Total': 123,
        'Cricket': 76,
        'Football': 12,
        'Hockey': 1,
        'None': 10
    },
    'C' : {
        'Total': 123,
        'Cricket': 76,
        'Football': 12,
        'Hockey': 1,
        'None': 10
    }   
}

I want to populate this in HighChart.. I am using this approach Highcharts - Multiple pie charts from json

but I need chart like this http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/pie-basic/

But I need three pie chart for A B C as in Above json.

1

1 Answers

0
votes

Try this example: http://jsfiddle.net/kkulig/2jq0dvgL/

Use following code to prepare your data before passing it to the chart constructor:

var data = [];
$.each(item, function(prop, value) {
  data.push({
    name: prop,
    y: value
  });
});