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

Commit 3428a22

Browse files
committed
Merge pull request #26 from nathandao/master
#25 addData support for round charts
2 parents cdebc28 + 77c135e commit 3428a22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/core.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ var updatePoints = function(nextProps, chart, dataKey) {
9090

9191
if (name === 'PolarArea' || name === 'Pie' || name === 'Doughnut') {
9292
nextProps.data.forEach(function(segment, segmentIndex) {
93-
chart.segments[segmentIndex].value = segment.value;
93+
if (!chart.segments[segmentIndex]) {
94+
chart.addData(segment);
95+
} else {
96+
chart.segments[segmentIndex].value = segment.value;
97+
}
9498
});
9599
} else {
96100
while (chart.scale.xLabels.length > nextProps.data.labels.length) {

0 commit comments

Comments
 (0)