This question is locked. New answers and comments are not allowed.
I am trying to populate a pie chart with a json call at runtime. I am successfully able to do so in a bar chart with code similar to this (found on another thread):
However, I am not able to use this option for the pie chart. How can it be done?
success: function (data) { // if the returned (echoed) ajaxId is the latest the client submitted then do something. If not then ignore var thechart = chart.data("tChart"); // remove existing series while (thechart.options.series.length > 0) { thechart.options.series.pop(); } var categories = ""; var colorIndex = 0; // Loop through the selected values and submit AJAX queries for (var i = 0; i < data.series.length; i++) { //debugger; thechart.options.series.push({ //color: colors[colorIndex], name: data.series[i].seriesName, type: "column", data: data.series[i].seriesValue.split(',') }); } thechart.options.categoryAxis.categories = data.categories; //.split(','); thechart.refresh(); thechart.rebind(data); }