Browse Source

do not scale down the radius if you are not expanding the arcs on hover

pull/1484/head
Brandon Heyer 9 years ago
parent
commit
3df96527a7
  1. 6
      src/arc.js

6
src/arc.js

@ -10,9 +10,11 @@ c3_chart_internal_fn.initPie = function () {
c3_chart_internal_fn.updateRadius = function () { c3_chart_internal_fn.updateRadius = function () {
var $$ = this, config = $$.config, 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; $$.radiusExpanded = Math.min($$.arcWidth, $$.arcHeight) / 2;
$$.radius = $$.radiusExpanded * 0.95; $$.radius = $$.radiusExpanded * ( expand ? 0.95 : 1 );
$$.innerRadiusRatio = w ? ($$.radius - w) / $$.radius : 0.6; $$.innerRadiusRatio = w ? ($$.radius - w) / $$.radius : 0.6;
$$.innerRadius = $$.hasType('donut') || $$.hasType('gauge') ? $$.radius * $$.innerRadiusRatio : 0; $$.innerRadius = $$.hasType('donut') || $$.hasType('gauge') ? $$.radius * $$.innerRadiusRatio : 0;
}; };

Loading…
Cancel
Save