We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c8e84aa + 6bdf66f commit 5c826afCopy full SHA for 5c826af
src/index.js
@@ -117,6 +117,11 @@ class ChartComponent extends React.Component {
117
// seamless transitions
118
let currentDatasets = (this.chart_instance.config.data && this.chart_instance.config.data.datasets) || [];
119
const nextDatasets = data.datasets || [];
120
+
121
+ // Prevent charting of legend items that no longer exist
122
+ while (currentDatasets.length > nextDatasets.length) {
123
+ currentDatasets.pop();
124
+ }
125
126
nextDatasets.forEach((dataset, sid) => {
127
if (currentDatasets[sid] && currentDatasets[sid].data) {
0 commit comments