Browse Source

Toggle target chart when legend clicked as default

pull/104/head
Masayuki Tanaka 11 years ago
parent
commit
436dc745d4
  1. 4
      c3.js
  2. 2
      c3.min.js

4
c3.js

@ -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 @@
.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);

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save