From 745b579db2b3ab358c6964f4c193de85e34fd470 Mon Sep 17 00:00:00 2001 From: Singhai Date: Fri, 13 Jul 2018 08:41:57 +0530 Subject: [PATCH] Fixing 2409 : Calling merge on backgroundArc before setting 'd' attribute. --- src/arc.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/arc.js b/src/arc.js index e77d1fe..3cf43ee 100644 --- a/src/arc.js +++ b/src/arc.js @@ -471,19 +471,20 @@ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransf if (hasGaugeType) { var index = 0; backgroundArc = $$.arcs.select('g.' + CLASS.chartArcsBackground).selectAll('path.' + CLASS.chartArcsBackground).data($$.data.targets); - backgroundArc.enter().append("path") - .attr("class", function (d, i) { return CLASS.chartArcsBackground + ' ' + CLASS.chartArcsBackground +'-'+ i; }) - .attr("d", function (d1) { - if ($$.hiddenTargetIds.indexOf(d1.id) >= 0) { return "M 0 0"; } - - var d = { - data: [{value: config.gauge_max}], - startAngle: config.gauge_startingAngle, - endAngle: -1 * config.gauge_startingAngle * (config.gauge_fullCircle ? Math.PI : 1), - index: index++ - }; - return $$.getArc(d, true, true); - }); + backgroundArc = backgroundArc.enter().append("path").merge(backgroundArc); + backgroundArc.attr("class", function (d, i) { + return CLASS.chartArcsBackground + ' ' + CLASS.chartArcsBackground + '-' + i; + }).attr("d", function (d1) { + if ($$.hiddenTargetIds.indexOf(d1.id) >= 0) { return "M 0 0"; } + + var d = { + data: [{ value: config.gauge_max }], + startAngle: config.gauge_startingAngle, + endAngle: -1 * config.gauge_startingAngle * (config.gauge_fullCircle ? Math.PI : 1), + index: index++ + }; + return $$.getArc(d, true, true); + }); backgroundArc.exit().remove(); $$.arcs.select('.' + CLASS.chartArcsGaugeUnit)