I am trying to get pie charts working with JSON. I have created a simple test using your examples as follows:
Code:
var chart1 = new EJSC.Chart('pie_chart', {
show_legend: false,
title: 'Pie Chart'
});
chart1.addSeries(new EJSC.PieSeries(new EJSC.JSONStringDataHandler(
'[{"x":3,"y":"Widgets"},{"x":7,"y":"Doodads"},{"x":4,"y":"Thingamagigs"},{"x":10,"y":"Whatchamacallits"},{"x":2,"y":"Gizmos"},{"x":5,"y":"Thingies"}]'
),
{
treeLegend: true ,
defaultColors: [
'rgb(255,140,0)', //DarkOrange
'rgb(178,34,34)', //FireBrick
'rgb(153,50,204)', //DarkOrchid
'rgb(255,255,0)', //Yellow
'rgb(112,219,147)', //AquaMarine
'rgb(35,107,142)' //SteelBlue
]
}
));
This renders the chart correctly except that the wedges simply say 7 of 31, 4 of 31 etc. The don't have the labels (Widgets, Doodads, etc.).
Should my JSON be in a different format or is there some other way to make it use the labels?
Thanks,
James