]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Handle effective dataset visibility per chart
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Thu, 21 Apr 2016 17:12:12 +0000 (19:12 +0200)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Tue, 26 Apr 2016 10:46:27 +0000 (12:46 +0200)
commit82b1e5cd99d77744aac3c1a3c532bbf99b2578cf
treee642ae8b2f032d34dc4e5aa5ad6f036ef31bc32f
parentf3457c99417e3e87f67b8b673c6d9ca046b3bc46
Handle effective dataset visibility per chart

Introduced a new meta.hidden 3 states flag (null|true|false) to be able to override dataset.hidden when interacting with the chart (i.e., true or false to ignore the dataset.hidden value). This is required in order to be able to correctly share dataset.hidden between multiple charts.

For example: 2 charts are sharing the same data and dataset.hidden is initially false: the dataset will be displayed on both charts because meta.hidden is null. If the user clicks the legend of the first chart, meta.hidden is changed to true and the dataset is only hidden on the first chart. If dataset.hidden changes, only the second chart will have the dataset visibility updated and that until the user click again on the first chart legend, switching the meta.hidden to null.
src/controllers/controller.bar.js
src/controllers/controller.doughnut.js
src/controllers/controller.line.js
src/controllers/controller.polarArea.js
src/core/core.controller.js
src/core/core.helpers.js
src/core/core.legend.js
src/core/core.tooltip.js
src/scales/scale.linear.js
src/scales/scale.logarithmic.js
src/scales/scale.radialLinear.js