I am trying to get the series data from a Highcharts chart once it has been called and loaded to the page.
So far I've only been successful in getting a bunch of strings that isn't what I am after obviously. Wonder if someone can help me with this one.
jQuery Code:
success: function (chartData) {
if(chart != undefined) {
$('#meterloader').hide();
$.each(chart.series[0], function(value) {
alert(value);
});
} else {
$('#meterloader').hide();
$('#meterbox').html("<div><p class='textcentre bold red'>There was an error loading the chart.</p></div>");
}
}
Thanks in advance.
To determine that chart is fully loaded you can use load event, because load event is invoked when all elements are drown (API reference https://api.highcharts.com/highcharts/chart.events.load). However when you are using series animation this runs in a timeout, then load event is invoked before animation will finish.
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.
The application can be used either as a CLI (Command Line Interface), as an HTTP server, or as a node. js module.
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend. It is possible to override the symbol creator function and create custom legend symbols.
you need plotted data from the chart, then try
chart.series[0].data
if you need all the options from series then try
chart.series
this will return the entire series structure of the chart.
I hope this is useful for you.
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