Chart.js: Feature request: Enable/disable datasets

Created on 14 Oct 2014  Â·  8Comments  Â·  Source: chartjs/Chart.js

It would be great if there was an option the enable/disable for different datasets, when you click on the legend, e.g. like the example chart "Site Traffic" here in CanvasJS: http://canvasjs.com/html5-javascript-line-chart/

enhancement

Most helpful comment

This has been addressed I the v2.0 branch. To hide a dataset, simply add a field to the dataset.

dataset = {
    hidden: true, // hides dataset
}

All 8 comments

Totally agree! This feature is necessary for fine grained control of your chart.

This has been addressed I the v2.0 branch. To hide a dataset, simply add a field to the dataset.

dataset = {
    hidden: true, // hides dataset
}

Couldn't find this in the documentation

Thanks it was really useful for me to

doesn't work on 2.5

This almost works for me... the data doesn't appear and the tooltip doesn't refer to it but in the legend its still visible ad the label I had set has a strikethrough style applied.

This almost works for me... the data doesn't appear and the tooltip doesn't refer to it but in the legend its still visible ad the label I had set has a strikethrough style applied.

me too

This almost works for me... the data doesn't appear and the tooltip doesn't refer to it but in the legend its still visible ad the label I had set has a strikethrough style applied.

That is the point of this feature. The user can then click on the label and view the data.

Was this page helpful?
0 / 5 - 0 ratings