How to use Chart.js/Highcharts with Meteor and Mongo Collections

Dear All,

I have been looking for an option to create charts on meteor querying the information from a mongoDB collection.

However I have found different topics on this forum and other sites related. But anyone have provided a very helpful and simple code example of use.

Many people just put something like > function()… … (data) * on data just put your data.
So…

I have seen that there are two main packages: CHART.JS and Highcharts.

Then could someone help me to provide a code example from these packages in order to know:

How can I create a chart using a meteor collection where:

  • You have to use the aggregate function with “match” or any query from a mongodb collection.
  • Call it on server side to create a method or publish function that I will use on client side.
  • On client side how to show the chart using the values returned on server side function.

I am a beginner on Meteor. And its very difficult for me to understand some technical comments.

I really appreciate all your help and time on this matter. I have read the information for both packages but using it on meteor on the way specified above there is no a good example.

Thanks in advance,

Have a great day.

For people who wants to use Chart.js 2 in an Angular2-Meteor project.

Use the package ng2-charts.

Thank you but is not helpful for me. I am not building an Angular2-Meteor project.

I just want to use chart.js or highcharts on client side in a simple meteor project calling the query on server side in a method o publish function and handle it.

But thank you for your time. Have a great day.

@fquesada If you are using React or Blaze, I think there are also some similar packages which can save your time.
Hope someone else who have done same work can answer you.

Thank you for all your help and time. I am still looking information, because I have to deliver a prototype in two weeks for my thesis, and if I can’t complete it I will lost everything :worried:

Have a great day,

Best Regards

Yeah, indeed there is a Chart.js port for React - react-chartjs

The following might help: http://www.highcharts.com/blog/195-meteor-standalone

Thank you for your help, I will take a look on it.

Have a great day,

Best Regards.