I couldn’t get the maazalik:highcharts package to work in my application (kept getting “Exception from Tracker afterFlush function” and undefined errors) but I found what says is the “Official wrapper for Highcharts, Highstock and Highmaps charting libraries.” so I tried it instead. While I can get a simple pie chart to show up, I can’t seem to format it (like changing the chart title for example) nor can I get other chart types to work such as a “gauge”.
I thought from looking at the actual documentation at http://www.highcharts.com/docs/getting-started/how-to-set-options that I could just add a parameter of ‘title:’ to my json properties and it would work, but that doesn’t seem to do anything:
Template.cumulativeCheckIn.helpers({
createChart: function() {
// Gather data:
var allSites = Sites.find().count(),
problemSites = Sites.find({siteStatus: {$ne: '2'}}).count(),
siteData = [{
y: problemSites,
name: "Incomplete"
}, {
y: allSites - problemSites,
name: "Complete"
}];
console.log("All Sites: " + allSites);
console.log("Issues: " + problemSites);
// Use Meteor.defer() to craete chart after DOM is ready:
Meteor.defer(function() {
// Create standard Highcharts chart with options:
Highcharts.chart('cumulativeCheckIn', {
series: [{
type: 'pie',
title: 'hello',
data: siteData
}]
});
});
}
});
I also tried changing the chart type to “gauge”, but then nothing displays at all. Is there any better documentation or working examples? I’m really needing to use something that looks like this: http://www.highcharts.com/demo/gauge-solid