Using the Highstock (Highcharts) library,
I'm wondering, how do I combine A) adding flags as in here (or see fig.1) with B) dynamically updating data, using the addPoint function (ex: series.addPoint([x, y], true, true)
see here). There doesn't seem to be a facility for it in the addPoint function.
series : [{ name : 'USD to EUR', data : data, id : 'dataseries' }, { type : 'flags', data : [{ x : Date.UTC(2011, 3, 25), title : 'H', text : 'Euro Contained by Channel Resistance' }], onSeries : 'dataseries', shape : 'circlepin', width : 16 }]
fig.1
I have taken a look at this SO question. But is seems to add a flag on an existing dataset. Can I add a data point, and an associated flag at the same time?
Any help's appreciated.
Thanks
=== EDIT ===>
@Sebastian-Bochan
Thanks for responding, and for the working example. However, for some reason, addPoint is not working for my setup.
So take a look at this jsfiddle. What I do is i) setup an initial graph with a call to (chart-fill …)
, then ii) call (chart-increment …)
which adds 1 point, then immediately tries to add 1 flag on that point. The part that isn't working is (-> ($ selector) (.highcharts) (.-series) (nth 9) (.addPoint { :x 1234567 :title "fubar"} true false))
. This isn't adding the flag as I'd expect.
I have 11 Series overlaid on top of 5 graphs. This includes one series of type "flag". I thought, maybe with so many Series, there was a problem referencing one of them. But if I look into my series, I can see that the flag is indeed the 9th one.
I'm also using Clojurescript code. But I don't think that's an issue, as the graph otherwise renders properly. Any ideas?
Please take look at example: http://jsfiddle.net/pGpU7/2/