Browse Source

Add tooltip ungrouping for multiple X. Fix #628.

pull/633/head
Derek Schultz 10 years ago
parent
commit
6c678fb283
  1. 14
      c3.js
  2. 4
      c3.min.js
  3. 14
      src/interaction.js

14
c3.js

@ -2281,15 +2281,23 @@
selectedData = sameXData.map(function (d) {
return $$.addName(d);
});
$$.showTooltip(selectedData, mouse);
if (config.tooltip_grouped) {
$$.showTooltip(selectedData, mouse);
}
else {
$$.showTooltip([closest], mouse);
}
// expand points
if (config.point_focus_expand_enabled) {
$$.expandCircles(closest.index, closest.id, true);
}
// Show xgrid focus line
$$.showXGridFocus(selectedData);
if (config.tooltip_grouped) {
// Show xgrid focus line
$$.showXGridFocus(selectedData);
}
// Show cursor as pointer if point is close to mouse position
if ($$.dist(closest, mouse) < 100) {

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

14
src/interaction.js

@ -271,15 +271,23 @@ c3_chart_internal_fn.generateEventRectsForMultipleXs = function (eventRectEnter)
selectedData = sameXData.map(function (d) {
return $$.addName(d);
});
$$.showTooltip(selectedData, mouse);
if (config.tooltip_grouped) {
$$.showTooltip(selectedData, mouse);
}
else {
$$.showTooltip([closest], mouse);
}
// expand points
if (config.point_focus_expand_enabled) {
$$.expandCircles(closest.index, closest.id, true);
}
// Show xgrid focus line
$$.showXGridFocus(selectedData);
if (config.tooltip_grouped) {
// Show xgrid focus line
$$.showXGridFocus(selectedData);
}
// Show cursor as pointer if point is close to mouse position
if ($$.dist(closest, mouse) < 100) {

Loading…
Cancel
Save