New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooltip for polygon appears without mouse in polygon #5337

Closed
xyzisinus opened this Issue May 24, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@xyzisinus

xyzisinus commented May 24, 2016

Expected behaviour

The tooltip should appear when the mouse hovers inside the polygon.

Actual behaviour

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

https://jsfiddle.net/xyzisinus/oeuq4jsu/

Affected browser(s)

Have tried Chrome and Firefox. Both are affected.

@xyzisinus

This comment has been minimized.

Show comment
Hide comment
@xyzisinus

xyzisinus May 24, 2016

The problem is for the arearange series, too. See example below. The tooltip implementation as a whole may need some rectification.

https://jsfiddle.net/xyzisinus/7sbbbvre/

xyzisinus commented May 24, 2016

The problem is for the arearange series, too. See example below. The tooltip implementation as a whole may need some rectification.

https://jsfiddle.net/xyzisinus/7sbbbvre/

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi May 25, 2016

Collaborator

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.

The problem is for the arearange series, too.

For the arearange the current tooltip implementation is correct, as it picks the closest point along the X axis. Area ranges display continuous data.

Collaborator

TorsteinHonsi commented May 25, 2016

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.

The problem is for the arearange series, too.

For the arearange the current tooltip implementation is correct, as it picks the closest point along the X axis. Area ranges display continuous data.

@xyzisinus

This comment has been minimized.

Show comment
Hide comment
@xyzisinus

xyzisinus May 25, 2016

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.

xyzisinus commented May 25, 2016

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.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi May 26, 2016

Collaborator

Yes, that would be covered by the followPointer option. Except for the problem that the tooltip appears when we're not over the shape, does this work as you expect? https://jsfiddle.net/oeuq4jsu/1/

Collaborator

TorsteinHonsi commented May 26, 2016

Yes, that would be covered by the followPointer option. Except for the problem that the tooltip appears when we're not over the shape, does this work as you expect? https://jsfiddle.net/oeuq4jsu/1/

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi
Collaborator

TorsteinHonsi commented May 26, 2016

Demo with the fix applied: http://jsfiddle.net/highcharts/oeuq4jsu/4/

@xyzisinus

This comment has been minimized.

Show comment
Hide comment
@xyzisinus

xyzisinus commented May 26, 2016

Thanks!

TorsteinHonsi added a commit that referenced this issue Jun 3, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment