I have the following chart in column format which works well:
$(document).ready(function() {
get_data();
function get_data() {
$.ajax({
url: 'get_data.aspx',
type: 'GET',
dataType: 'json',
success: function(results) {
var chart1 = new Highcharts.Chart( {
chart: {
renderTo: 'chart',
defaultSeriesType: 'column'
},
series: results
});
}
});
}
});
But when I try changing the defaultSeriesType to pie, I just get a single value in the pie. I am assuming I need to format my json data differently for pie charts?
The chart above is using the following json data:
[
{
"name": "DEP1",
"data": [
100
]
},
{
"name": "DEP2",
"data": [
200
]
},
{
"name": "DEP3",
"data": [
300
]
},
{
"name": "DEP4",
"data": [
400
]
},
{
"name": "DEP5",
"data": [
500
]
},
{
"name": "DEP6",
"data": [
600
]
}
]
According to http://www.highcharts.com/demo/pie-basic, your data needs to be in the format