I am able to set data to the main pie chart using
var data = [1,2,3,4,5]; //value of data will be returned through an AJAX call
chart1.series[0].setData(data);
Similarly, how do I set the drilldown data dynamically?
I tried with
chart1.drilldown[0].data = '[1,2,3]';
but it did not work.
I am using RESTful
services to expose data.
You can access drilldown at runtime using chart.options.drilldown
var newDrillDowns = {
id: 'my drilldowns',
data: [
['Cat1', 4],
['Cat2', 2],
['Cat3', 1]
]};
chart.options.drilldown.series[0] = newDrillDowns;
In the same way you can replace drilldowns completely
chart.options.drilldown.series = [newDrillDowns];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With