From 3df96527a7da90f016e13ec4a9056b0a86b8d001 Mon Sep 17 00:00:00 2001 From: Brandon Heyer Date: Thu, 3 Dec 2015 11:05:21 -0500 Subject: [PATCH] do not scale down the radius if you are not expanding the arcs on hover --- src/arc.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/arc.js b/src/arc.js index df2f995..2163360 100644 --- a/src/arc.js +++ b/src/arc.js @@ -10,9 +10,11 @@ c3_chart_internal_fn.initPie = function () { c3_chart_internal_fn.updateRadius = function () { var $$ = this, config = $$.config, - w = config.gauge_width || config.donut_width; + w = config.gauge_width || config.donut_width, + expand = ( ($$.hasType('donut') && config.donut_expand) || ($$.hasType('guage') && config.gauge_expand) || ($$.hasType('pie') && config.pie_expand) ); + $$.radiusExpanded = Math.min($$.arcWidth, $$.arcHeight) / 2; - $$.radius = $$.radiusExpanded * 0.95; + $$.radius = $$.radiusExpanded * ( expand ? 0.95 : 1 ); $$.innerRadiusRatio = w ? ($$.radius - w) / $$.radius : 0.6; $$.innerRadius = $$.hasType('donut') || $$.hasType('gauge') ? $$.radius * $$.innerRadiusRatio : 0; };