I implemented HightCharts in my Meteor App using this tutorial and it works fine for the beginning.
problem1 : I was trying to implement the rangeButtons like in the full example bellow, but there is nothing showing up. Any idea why?
problem 2: After solving problem1, how in the world could i link the buttons to the database if i was to display for example a count for all DB Items created in day for the duration of a week, month, year?
html
<div id="chart">{{createChart}}</div>
js
var Highcharts = require('highcharts/highstock');
Meteor.subscribe("cvs");
Template.Statistici.helpers({
createChart: function () {
totalInterviuri = Cvs.find().count()
totalAngajati = Cvs.find({ createdAd: { $regex: '^2016-09-15' } }).count()
// Use Meteor.defer() to craete chart after DOM is ready:
Meteor.defer(function () {
Highcharts.chart('chart', {
series: [{
name: 'Angajati',
type: 'line',
data: [{
y: totalAngajati,
},
{
y: 3
},
{
y: 2
},
{
y: 4
}
],
allowPointSelect: true,
dataLabels: {
enabled: true
},
}, {
name: "Interviuri",
type: 'line',
data: [{
y: totalInterviuri,
},
{
y: 6
},
{
y: 7
},
{
y: 5
},
]
}],
rangeSelector: {
allButtonsEnabled: true,
selected: 2
},
});
});
}
})