mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-11 18:56:49 +01:00
Merge pull request #3315 from zachpanz88/fix-pie-multi-dataset
Fix error where pie/doughnut charts did not render correctly with multiple datasets
This commit is contained in:
@@ -76,7 +76,10 @@ module.exports = function(Chart) {
|
||||
|
||||
for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
|
||||
meta = chart.getDatasetMeta(i);
|
||||
meta.data[index].hidden = !meta.data[index].hidden;
|
||||
// toggle visibility of index if exists
|
||||
if (meta.data[index]) {
|
||||
meta.data[index].hidden = !meta.data[index].hidden;
|
||||
}
|
||||
}
|
||||
|
||||
chart.update();
|
||||
|
||||
Reference in New Issue
Block a user