blacklabel / annotations

Annotations plugin for Highstock by Black Label
http://blacklabel.github.io/annotations/
Other
22 stars 16 forks source link

Is it possible to save the annotation? #47

Closed kumaresanm closed 9 years ago

kumaresanm commented 9 years ago

If I share the chart with some one he should also be able to see the annotation that I have created.

pawelfus commented 9 years ago

Sorry for a late reply! Yes, of course this is possible. Simply store all created annotations-options from chart.annotations.allItems[index].options, for example:

var annotations = [];
$.each(chart.annotations.allItems, function(i, ann) {
  annotations.push(ann.options);
});

Now just save your data (annotations array in the example above) in your database with connected chart. Later, when loading chart, load annotations from the database and create chart with them.