Skip to content
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 position when xAxis.left is set #2062

Closed
pawelfus opened this issue Jul 24, 2013 · 12 comments
Closed

Tooltip position when xAxis.left is set #2062

pawelfus opened this issue Jul 24, 2013 · 12 comments
Labels
Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. Type: Bug

Comments

@pawelfus
Copy link
Contributor

pawelfus commented Jul 24, 2013

Example: http://jsfiddle.net/45v24/4/

The idea here is to use two separate xAxis both starting from 0, or with different categories, and the tooltip is mispositioned (hover orange series).

@Guillaume84
Copy link

Hello Pawel,

Thank you for getting back to me. My bad for not reviewing the code, and my guess is the original programmer must have disabled the tooltip precisely for the issue which you highlight above...

Have you identified a workaround for the issue? Is it possible to offset all tooltips on the second chart by a given number of pixels? It doesn't look like the y-axis positioning is wrong, just the x-axis.

Kind regards and thanks for your help.
Guillaume

@TorsteinHonsi
Copy link
Collaborator

Simplified demo: http://jsfiddle.net/highcharts/X7GKs/

@pawelfus
Copy link
Contributor Author

Possible workaround is to setup tooltip.positioner, like this: http://jsfiddle.net/X7GKs/1/
Good idea will be to detect edges or just set higher margins (left/right) - see: http://jsfiddle.net/X7GKs/2/.

@Guillaume84
Copy link

Pawel, this is absolutely awesome. Thank you!

Any reason why the x-axis of the second chart is below that of the first? Why are these not aligned?

@pawelfus
Copy link
Contributor Author

Just set offset for second xAxis, see: http://jsfiddle.net/X7GKs/3/

@Guillaume84
Copy link

Hello Pawel -that works perfectly, but then breaks if you change the graph to a line chart. Is that expected behaviour, or is it because the positioning methodology you have adopted no longer applies to line charts? Appreciate this is only very loosely related to my initial question, so please feel free to tell me to go away :-)

Thanks again for all your help. I am nearly there.

@pawelfus
Copy link
Contributor Author

Looks like my workaround works only for columns. For line chart, tooltip doesn't display at all, so there must be something broken deeper in the core, sorry.

Test case for lines: http://jsfiddle.net/X7GKs/4/

@Guillaume84
Copy link

Hello Pawel,

This isn't 100% correct -your workaround does bring about the tooltips with the line graph, but these are not positioned correctly. To reproduce this, go to this link and replace type: 'columns' with type: 'line'. How about setting all tooltips to a fixed location? e.g. top left corner...?

http://jsfiddle.net/X7GKs/3/

@pawelfus
Copy link
Contributor Author

This one: http://jsfiddle.net/X7GKs/5/ ? I can see tooltip only for last point (sometimes..).

@Guillaume84
Copy link

Hello Pawel,

Yeah, that is the one I was referring to. I assumed if you could see the last one when hovering on the first it meant there was an issue with the positioning. :-)

As always, thank you for your help and for being so responsive. I will close down my question on SO. Do let me know if you identify a workaround!

Kind regards,
Guillaume

@ghost
Copy link

ghost commented May 15, 2014

http://jsfiddle.net/X7GKs/5/

Hide the first series (blue one)
Hover over the second, no tooltip appears.
Move the mouse to the 'first' chart, the tooltip appears.

It seems that Highcharts thinks the graph is still there (if you move it around you will see that it gives the correct tooltip if the graph would still have been there)

@stale
Copy link

stale bot commented May 16, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@stale stale bot added the Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. label May 16, 2019
@stale stale bot closed this as completed May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Stale This issue hasn't had any activity for a while, and will be auto-closed if no further updates occur. Type: Bug
Projects
None yet
Development

No branches or pull requests

3 participants