diff --git a/src/config.js b/src/config.js index ae9aa9f..78daccf 100644 --- a/src/config.js +++ b/src/config.js @@ -18,6 +18,7 @@ c3_chart_internal_fn.getDefaultConfig = function () { zoom_onzoomend: function () {}, zoom_x_min: undefined, zoom_x_max: undefined, + interaction_brighten: true, interaction_enabled: true, onmouseover: function () {}, onmouseout: function () {}, diff --git a/src/selection.js b/src/selection.js index e538763..b71d286 100644 --- a/src/selection.js +++ b/src/selection.js @@ -30,14 +30,18 @@ c3_chart_internal_fn.togglePoint = function (selected, target, d, i) { c3_chart_internal_fn.selectPath = function (target, d) { var $$ = this; $$.config.data_onselected.call($$, d, target.node()); - target.transition().duration(100) - .style("fill", function () { return $$.d3.rgb($$.color(d)).brighter(0.75); }); + if ($$.config.interaction_brighten) { + target.transition().duration(100) + .style("fill", function () { return $$.d3.rgb($$.color(d)).brighter(0.75); }); + } }; c3_chart_internal_fn.unselectPath = function (target, d) { var $$ = this; $$.config.data_onunselected.call($$, d, target.node()); - target.transition().duration(100) - .style("fill", function () { return $$.color(d); }); + if ($$.config.interaction_brighten) { + target.transition().duration(100) + .style("fill", function () { return $$.color(d); }); + } }; c3_chart_internal_fn.togglePath = function (selected, target, d, i) { selected ? this.selectPath(target, d, i) : this.unselectPath(target, d, i);