Skip to content

Commit fd1caab

Browse files
committed
fix(c3-chart): stop donutPctCharts without a threshold attribute from regenerating when updating data
1 parent 57bffae commit fd1caab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/charts/c3/c3-chart.component.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
chartData = ctrl.config;
9898
if (chartData) {
9999
chartData.bindto = '#' + $attrs.id;
100-
// always re-generate donut pct chart because it's colors
101-
// change based on data and thresholds
102-
if (!chart || $attrs.id.includes('donutPctChart')) {
100+
// only re-generate donut pct chart if it has a threshold object
101+
// because it's colors will change based on data and thresholds
102+
if (!chart || ($attrs.id.includes('donutPctChart') && chartData.thresholds)) {
103103
chart = c3.generate(chartData);
104104
} else {
105105
//if chart is already created, then we only need to re-load data

0 commit comments

Comments
 (0)