Slime recipe
Slime recipe

Reputation: 2263

Adding flags to highcharts (not highstock) dynamically

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?

Upvotes: 1

Views: 4802

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

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/

Upvotes: 2

Related Questions