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

Commit 2aeca03

Browse files
committed
Merge pull request #92 from lauffenp/master
Radar Chart Redraw Fix
2 parents c3ab981 + d7871c9 commit 2aeca03

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

lib/core.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ module.exports = {
4747
updatePoints(nextProps, chart, dataKey);
4848
if (chart.scale) {
4949
chart.scale.xLabels = nextProps.data.labels;
50+
51+
if (chart.scale.calculateXLabelRotation){
5052
chart.scale.calculateXLabelRotation();
53+
}
5154
}
5255
chart.update();
5356
}
@@ -108,6 +111,17 @@ var updatePoints = function(nextProps, chart, dataKey) {
108111
while(nextProps.data.length < chart.segments.length) {
109112
chart.removeData();
110113
}
114+
} else if (name === "Radar") {
115+
chart.removeData();
116+
nextProps.data.datasets.forEach(function(set, setIndex) {
117+
set.data.forEach(function(val, pointIndex) {
118+
if (typeof(chart.datasets[setIndex][dataKey][pointIndex]) == "undefined") {
119+
addData(nextProps, chart, setIndex, pointIndex);
120+
} else {
121+
chart.datasets[setIndex][dataKey][pointIndex].value = val;
122+
}
123+
});
124+
});
111125
} else {
112126
while (chart.scale.xLabels.length > nextProps.data.labels.length) {
113127
chart.removeData();

0 commit comments

Comments
 (0)