highcharts - Add Flag based on button event -


series: [{  type: 'flags', name: 'flags on axis',  data: [{ x: date.utc(2011, 2, 1), title: 'a'  }, { x: date.utc(2011, 5, 1), title: 'c' }],  shape: 'squarepin' }]   $("#btnaddflag").click(function () {  chart.series[0].setdata( {  x: date.utc(2011, 2, 1), title: 'b' });  }); 

above code part of highstock chart option , want add flag based on user event click. able add new point flag chart existing flags title , c missed out.

  1. how can add new flag chart existing flags ?

  2. on other hand, able flag data i'm unsure generate correct data structure , reinitialize old , new flag data chart.

thank you.

use addpoint instead of setdata.

http://api.highcharts.com/highstock#series.addpoint()

$("#btnaddflag").click(function () {   chart.series[0].addpoint({     x: date.utc(2011, 2, 1),     title: 'b'   }); }); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -