It might be a silly question but I want to ask anyway
I want to do some mathematical analysis and want to store them in Mongodb. (this part is easy)
But I want to show these numbers in charts on a page for each data items from directly mongodb. In some ways it looks like a blog system user can create stuff and see them on a page like example.com/data/data_id .
Can you give me an example code for highcharts using data from mongodb ?
You propably can´t use it 1:1 with your data. It depends on how your data looks and what kind of chart / data you need.
Highcharts has many examples you can look at. Look at the json data the examples use and shape your json results from mongodb accordingly. Underscore is just one option for it.
I have reactively updating Highcharts in one of my apps. I could probably offer more targeted help if you can tell me exactly what you are wanting to do.
I have two array objects in my mongodb collections. And I want to show them in highchart on X and Y. for example windspeed_arr[15,12,14,10] power_arr[100,122,140,155] . power_arr[i] is the output power of the windspeed_arr[i] . I want to show them on a line chart.
I prepared two code examples. The first is a very basic example which redraws the chart everytime something in the Data collection changed. If you dont want that you might like example two. Here we update the data of the chart everytime something changes in the collection but this time only the new point is added to the chart. I hope i understood your problem correctly If thats not the case, can you provide a jsFiddle example of the chart you want?
This is a great example but it looks like its for a none meteor app. Would you know how to format this for Meteor and what atmosphere package implements it?
The missing piece of information is within the data callback. Instead of generating a random number, add an observer onto your collection and use it to append to a list as an initial test. Eg:
The easiest way would be to take a timeout function and rerun the data gathering. However, this would generate a lot of overhead. You could use @corvid s solution or use one of the other examples.