Commit 436dc745 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Toggle target chart when legend clicked as default

parent c66e0a7a
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
// legend // legend
var __legend_show = getConfig(['legend', 'show'], true), var __legend_show = getConfig(['legend', 'show'], true),
__legend_position = getConfig(['legend', 'position'], 'bottom'), __legend_position = getConfig(['legend', 'position'], 'bottom'),
__legend_item_onclick = getConfig(['legend', 'item', 'onclick'], function () {}), __legend_item_onclick = getConfig(['legend', 'item', 'onclick']),
__legend_equally = getConfig(['legend', 'equally'], false); __legend_equally = getConfig(['legend', 'equally'], false);
// axis // axis
...@@ -3459,7 +3459,7 @@ ...@@ -3459,7 +3459,7 @@
.attr('class', function (id) { return generateClass(CLASS.legendItem, id); }) .attr('class', function (id) { return generateClass(CLASS.legendItem, id); })
.style('cursor', 'pointer') .style('cursor', 'pointer')
.on('click', function (id) { .on('click', function (id) {
__legend_item_onclick(id); typeof __legend_item_onclick === 'function' ? __legend_item_onclick(id) : c3.toggle(id);
}) })
.on('mouseover', function (id) { .on('mouseover', function (id) {
c3.focus(id); c3.focus(id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment