Join GitHub today
tooltip for polygon appears without mouse in polygon #5337
The tooltip should appear when the mouse hovers inside the polygon.
The tooltip appears once the mouse is in the chart. It is the tooltip for whichever polygon the mouse is the nearest.
Live demo with steps to reproduce
Have tried Chrome and Firefox. Both are affected.
With the current implementation (v4.2.5), the polygon series is a simple extension of the scatter series. In a scatter series, the tooltip displays for the point that is closest in distance to the mouse cursor, and the polygon series inherits this.
But in most cases this doesn't make sense for a polygon. I think the best default tooltip implementation for polygons would be that they appear on hover over the polygon and follow the pointer around, like in this example for columns. We probably have the building blocks to achieve that in the Pointer class, with one important difference that the polygon shape relates to the whole series, while the column relates to a single point.
For the arearange the current tooltip implementation is correct, as it picks the closest point along the X axis. Area ranges display continuous data.
I would like to have another enhancement for polygon, too. Now, the expected behavior is: When the mouse is in the area defined by the polygon, the most nearby vertex "lights up". I'd like to have an option that disables the "light up" of any vertex. That's because some polygons are about the defined area, not about the vertexes.