Browse Source

Change legend method customization/override to be consistent across all methods.

pull/1209/head
James Garfield 10 years ago
parent
commit
26d8c3e061
  1. 16
      src/legend.js

16
src/legend.js

@ -240,20 +240,24 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
}
})
.on('mouseover', function (id) {
$$.d3.select(this).classed(CLASS.legendItemFocused, true);
if (!$$.transiting && $$.isTargetToShow(id)) {
$$.api.focus(id);
}
if (config.legend_item_onmouseover) {
config.legend_item_onmouseover.call($$, id);
}
else {
$$.d3.select(this).classed(CLASS.legendItemFocused, true);
if (!$$.transiting && $$.isTargetToShow(id)) {
$$.api.focus(id);
}
}
})
.on('mouseout', function (id) {
$$.d3.select(this).classed(CLASS.legendItemFocused, false);
$$.api.revert();
if (config.legend_item_onmouseout) {
config.legend_item_onmouseout.call($$, id);
}
else {
$$.d3.select(this).classed(CLASS.legendItemFocused, false);
$$.api.revert();
}
});
l.append('text')
.text(function (id) { return isDefined(config.data_names[id]) ? config.data_names[id] : id; })

Loading…
Cancel
Save