Skip to content

Commit cf207ff

Browse files
authored
Merge pull request #578 from aptmac/fix-c3-chart-transitions
Fix transitions in c3-charts and non-threshold donutPctCharts
2 parents a91312c + 501d436 commit cf207ff

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.indexOf('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.indexOf('donutPctChart') !== -1 && 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)