react-chartjs
react-chartjs copied to clipboard
Doughnut's color, label do not change when receiving new props data
When I add new data for Doughnut chart, the value changes but not the label or color. Checking the code, it seems like the only change is value
if (name === 'PolarArea' || name === 'Pie' || name === 'Doughnut') {
nextProps.data.forEach(function(segment, segmentIndex) {
if (!chart.segments[segmentIndex]) {
chart.addData(segment);
} else {
chart.segments[segmentIndex].value = segment.value;
}
});
}
I don't want to use redraw because of ugly animation.