Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Commit 07b095c

Browse files
committed
Merge pull request #88 from TheCrow1213/master
Removing old segments on update.
2 parents 01b7201 + b19eee8 commit 07b095c

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

dist/react-chartjs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@ return /******/ (function(modules) { // webpackBootstrap
184184
});
185185
}
186186
});
187+
188+
while(nextProps.data.length < chart.segments.length) {
189+
chart.removeData();
190+
}
187191
} else {
188192
while (chart.scale.xLabels.length > nextProps.data.labels.length) {
189193
chart.removeData();

dist/react-chartjs.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/core.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ var updatePoints = function(nextProps, chart, dataKey) {
104104
});
105105
}
106106
});
107+
108+
while(nextProps.data.length < chart.segments.length) {
109+
chart.removeData();
110+
}
107111
} else {
108112
while (chart.scale.xLabels.length > nextProps.data.labels.length) {
109113
chart.removeData();

0 commit comments

Comments
 (0)