From b65ad6d78eb2e492a09866b3b57b3b8912bdb438 Mon Sep 17 00:00:00 2001 From: arnsvel Date: Thu, 13 Jun 2019 11:54:30 +0900 Subject: [PATCH] Make sure innerRadius is not NaN value Error: attribute dx: Expected length, "NaNpx". Replication: Happens every time lost focus from/to browser tab when gauge chart is dynamically generated. Investigation: w = config.gauge_width is has assigned value 10 $$.innerRadiusRatio is -Infinity $$.innerRadius is NaN --- src/arc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arc.js b/src/arc.js index 5c2df6781..1396554ad 100644 --- a/src/arc.js +++ b/src/arc.js @@ -492,7 +492,8 @@ ChartInternal.prototype.redrawArc = function (duration, durationForExit, withTra backgroundArc .exit() .remove(); - + + $$.innerRadius = $$.innerRadius || 0; $$.arcs.select('.' + CLASS.chartArcsGaugeUnit) .attr("dy", ".75em") .text(config.gauge_label_show ? config.gauge_units : '');