I am struggling to figure out the right way to update the tall chart diagram. Suppose I display a chart, and then I want to update it somehow. For example, I can change the values โโof a data series, or I may want to include dataLabels.
new Highcharts.chart now, the only way to figure out how to do this is to change the chart options and use new Highcharts.chart to show the redrawing of the high charts.
However, I am wondering if this might be redundant, and it may be possible to change the diagram in place without having to start from scratch using new Highcharts.chart . I notice that there is a redraw() method, but I cannot get it to work.
Any help is greatly appreciated.
Thank,
Robin
The sample code is as follows, and below is jsFiddle
$(document).ready(function() { chartOptions = { chart: { renderTo: 'container', type: 'area', }, series: [{ data: [1,2,3] }] }; chart1 = new Highcharts.Chart(chartOptions); chartOptions.series[0].data= [10,5,2]; chart1 = new Highcharts.Chart(chartOptions);
http://jsfiddle.net/sUXsu/18/
[edit]:
For any future viewers of this question, it is worth noting that there is no way to hide and show dataLabels. The following shows how to do this: http://jsfiddle.net/supertrue/tCF8Y/
javascript highcharts
RobinL Dec 31 '13 at 9:46 2012-12-31 09:46
source share