Chartjs-How to create chart lists from a mongo collection elements in Meteor

1๐Ÿ‘

โœ…

1) fetch the data on the client:

var dataset = Data.find({<--whatever-query-you-need-->},{fields: {labels:1, rating:1}}).fetch()

2) map the field to what you need:

var labels = dataset.map(function(d) { return d.label; }
var data = dataset.map(function(d) {return d.rating; }

if you use d3js you may be able to just pass the data to the enter function and then the mapping function to each axis.

Leave a comment