Skip to content

[BUG] Tooltip labels for equal data not combining using mode: nearest #5371

@koltclassic

Description

@koltclassic

Expected Behavior

When hovering over two lines with equivalent data points, I would expect to see a tooltip with labels for both data points.

Current Behavior

When hovering over two lines with equivalent data points, the tooltip data does not combine. Rather, each individual tooltip "flashes" repeatedly one after the other.

Possible Solution

I would assume this would be an issue with the nearest method under Chart.Tooltip.positioners ?
Though there is also a getNearestItems function in core.interaction.js that might be worth checking out as well (side note: there is a typo in the getNearestItems comment, "teh" -> "the" 😄 )

Steps to Reproduce (for bugs)

From: http://www.chartjs.org/samples/latest/tooltips/interactions.html
chartjstooltipbug

Context

This doesn't impact me directly, but I could see it being an issue.

Environment

  • Chart.js version: Latest (2.7.2)
  • Browser name and version: Latest Chrome (65), Latest Firefox (59), Latest Safari (11)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions