From b7a2e6cd9e9c15db8ac953416d15f2131aa76e4c Mon Sep 17 00:00:00 2001 From: Anthony Pessy Date: Wed, 23 Aug 2017 13:30:05 +0200 Subject: [PATCH] Focused radius now can accept a function (#1704) It fixes #1571 --- src/shape.line.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/shape.line.js b/src/shape.line.js index 421d7f9..bdb03c7 100644 --- a/src/shape.line.js +++ b/src/shape.line.js @@ -372,7 +372,11 @@ c3_chart_internal_fn.pointR = function (d) { }; c3_chart_internal_fn.pointExpandedR = function (d) { var $$ = this, config = $$.config; - return config.point_focus_expand_enabled ? (config.point_focus_expand_r ? config.point_focus_expand_r : $$.pointR(d) * 1.75) : $$.pointR(d); + if (config.point_focus_expand_enabled) { + return isFunction(config.point_focus_expand_r) ? config.point_focus_expand_r(d) : ((config.point_focus_expand_r) ? config.point_focus_expand_r : $$.pointR(d) * 1.75); + } else { + return $$.pointR(d); + } }; c3_chart_internal_fn.pointSelectR = function (d) { var $$ = this, config = $$.config;