I have a chart working fine with data in the options, when I leave the data empty for a series and try the below (so I can change the data depending on a click) it doesn't work, any ideas?
options.series[0].data = [35.00,35.91,36.82,37.73,38.64]; var chart = new Highcharts.Chart(options);
The plotOptions is a wrapper object for config objects for each series type. The config objects for each series can also be overridden for each series item as given in the series array. Configuration options for the series are given in three levels. Options for all series in a chart are given in the plotOptions.
A series is a set of data, for example a line graph or one set of columns. All data plotted on a chart comes from the series object.
Re: High Charts Data LimitBy default it is set to 1000, you should increase this value in your chart. If you are having problems with your chart it is good habit to open the console (Developer Tools) and look for errors.
If you are a developer who would like to create hosted charts programmatically, then the Highcharts Cloud API might be for you.
you can also go with series.setData()
. This will allow you to change the entire data of a particular series.
Here is the API link for it.
Hope this will be of use for you.
You can update the values dynamically as follows :
chart.series[0].setData([89,71,16,12,14]);
If you want to change both value and label, create an array of arrays:
chart.series[0].setData([['Apple',89], ['Orange',71], ['Banana',16], ['Grapes',12], ['Others',14]]);
JSFiddle Demo to update data on a button click.
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