0

The way I have been doing it so far is to use Meteor.call and reset all the series in the callback, adding all the points all over. I then fetch new data using $interval every 5 seconds or so. This is obviously not very efficient and my data set is growing.

Now I'm trying to switch to a Meteor subscription since it feels like the right tool for the job.

The first challenge was how to add (a single time) all the points that are already in the collection. I solved that by using the onReady callback of a subscription.

Now my question is: how do I process the subsequent updates to the series on the chart? I have a helper collection which is supposed to receive the updates and although this works transparently when used in an ng-repeat, I find it difficult to interact with outside of this use case.

I tried to $watch it but the watcher does not trigger.

The Higcharts documentation has a pure Meteor example on how to do what I want: http://www.highcharts.com/blog/195-meteor-standalone, but how do can I adapt it for angularjs-meteor?

neric
  • 3,927
  • 3
  • 21
  • 25

1 Answers1

0

Use ng-highcharts, and make sure your series is linked to the helper result.

Tally Barak
  • 282
  • 4
  • 11