mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Fix bug with pie/doughnut chart legends
Fixes a rendering issue when there are multiple datasets on a pie chart and they do not all contain the same number of data in their datasets Fixes #3309
This commit is contained in:
parent
5c5b1bfe59
commit
051f5b015b
@ -76,8 +76,11 @@ module.exports = function(Chart) {
|
||||
|
||||
for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
|
||||
meta = chart.getDatasetMeta(i);
|
||||
// toggle visibility of index if exists
|
||||
if (meta.data[index]) {
|
||||
meta.data[index].hidden = !meta.data[index].hidden;
|
||||
}
|
||||
}
|
||||
|
||||
chart.update();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user