Chartjs-How do I access Chart.js default settings? (& related โ€” how do I turn the tool tips on?)

1๐Ÿ‘

โœ…

I downloaded Chart.js using Bower. The version of Chart.js listed on Bower is old. That is why the documentation was wrong. I had to cut and paste the newest Chart.js from Github into my project. And voila, tooltips and the object behaves as the documentation says it should.
Alternatively, and easier, as JAAulde pointed out, you can just set your bower dependecies to point to:

  "chartjs": "master"

and that should automatically pull the right copy.

0๐Ÿ‘

theChart and theDough should be set in one go, not as separate objects. For example:

var theChart = new Chart(ctx).Doughnut(data);

If this still does not get you tooltips, pass in and modify the following options:

var theChart = new Chart(ctx).Doughnut(data, {
     // Boolean - Determines whether to draw tooltips on the canvas or not
     showTooltips: true,
});

For further variety in your tooltips styling, check out the documentation for global chart options on this page: http://www.chartjs.org/docs/#getting-started-global-chart-configuration

Leave a comment