-
Notifications
You must be signed in to change notification settings - Fork 19.6k
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
Tooltips should not leave (window) #5004
Comments
Thanks for your reply, and pointing me to the English docs. I didn't even know the English docs for eCharts 3 were already available. Well, It completely overlaps the chart. Also, one thing I really like about eCharts is the ability for tooltips to be outside of the chart canvas. You do not see that often in charting libraries. |
@JeffreyRoosendaal - were you able to fix this? |
@JeffreyRoosendaal Interested in this as well, it makes no sense to display the tooltip outside of the window. |
Hi, This remains an issue on the latest version (4.5.0). I am not sure why this was marked as stale, as there is currently no sufficient solution. |
For anyone else struggling with this, I've written a function for the position callback that solves this. It first attempts to place the tool-tip to the top right of the mouse position. If it overflows to the right, it flips it to the left. If it then overflows to the left, it places it a fixed distance from the left edge of the window (since there's no better placement on the X axis at this point). And vice versa for top and bottom placement, with the fallback here placing it a fixed distance from the top edge of the window. Notes:
|
when you have more than one chart in a row the above solution can not help you. I changed a condition for tooltip position as below :
|
I know its an old ticket, but its high in Google results. eCharts 3 now has a new property which does the job perfectly.
|
When using a chart near the edge of your browser window, it may get cut off. I've tried setting
confine: true
, but this does not give the desired effect, since then it will be completely isolated in the chart div. This may not be a problem for large charts, but for small sparkline charts it is a problem.Since I think this is unintended behaviour (I can't think of a reason why a tooltip would display outside of your
window
), I think this is a bug.I am using the latest eCharts (3.4.0) with Google Chrome (55.0.2) on Windows 10
The text was updated successfully, but these errors were encountered: