Adding flags to highcharts (not highstock) dynamically

情到浓时终转凉″ 提交于 2020-01-03 02:25:31

问题


I found this jsfiddle and I'd like to implement that after the series had been created. often I let the user update the chart, I do this by sending array of float to the setData function of the series.

for example:

//Build the area values
for (var i = 0; i < area.length; i++)
{
    areaValues.push(parseFloat(area[i]));
}

chart.series[2].setData(areaValues,false);
chart.redraw();

Is there any way to add flags before the redraw without recreating the chart?


回答1:


The problem is in your data format - for flags should be this one:

{
    x: 9,
    title: 'I',
    text: 'Information'
}

Not just a number. You can achieve what you need in a two ways, or by setting new data, or adding new series, see example of both: http://jsfiddle.net/sH777/180/



来源:https://stackoverflow.com/questions/14302908/adding-flags-to-highcharts-not-highstock-dynamically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!