Browse Source

Fix tooltip when multiple xs on multiple charts - #758

pull/785/head
Masayuki Tanaka 10 years ago
parent
commit
d8e5e8162d
  1. 4
      c3.js
  2. 2
      c3.min.js
  3. 4
      src/data.js

4
c3.js

@ -1787,8 +1787,8 @@
// find mouseovering bar // find mouseovering bar
values.filter(function (v) { return v && $$.isBarType(v.id); }).forEach(function (v) { values.filter(function (v) { return v && $$.isBarType(v.id); }).forEach(function (v) {
var shape = $$.d3.select('.' + CLASS.bars + $$.getTargetSelectorSuffix(v.id) + ' .' + CLASS.bar + '-' + v.index).node(); var shape = $$.main.select('.' + CLASS.bars + $$.getTargetSelectorSuffix(v.id) + ' .' + CLASS.bar + '-' + v.index).node();
if ($$.isWithinBar(shape)) { if (!closest && $$.isWithinBar(shape)) {
closest = v; closest = v;
} }
}); });

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
src/data.js

@ -309,8 +309,8 @@ c3_chart_internal_fn.findClosest = function (values, pos) {
// find mouseovering bar // find mouseovering bar
values.filter(function (v) { return v && $$.isBarType(v.id); }).forEach(function (v) { values.filter(function (v) { return v && $$.isBarType(v.id); }).forEach(function (v) {
var shape = $$.d3.select('.' + CLASS.bars + $$.getTargetSelectorSuffix(v.id) + ' .' + CLASS.bar + '-' + v.index).node(); var shape = $$.main.select('.' + CLASS.bars + $$.getTargetSelectorSuffix(v.id) + ' .' + CLASS.bar + '-' + v.index).node();
if ($$.isWithinBar(shape)) { if (!closest && $$.isWithinBar(shape)) {
closest = v; closest = v;
} }
}); });

Loading…
Cancel
Save