-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
How to set the position of tooltip? #1928
Comments
@crazyBenqer which version of chart.js are you using? It'd be great if you could attach a JSFiddle demonstrating the issue as well. |
Thanks for your response, the version that I used is '1.0.2', and the following is my js code. var ctx=$("#Chart").get(0).getContext("2d"); |
Hey @etimberg – looks like I'm running into a similar issue where I've got a pie chart with relatively long text labels that are extending past the bounds of the canvas, which is causing them to get cut off. I've put together a little jsfiddle that demonstrates what I'm seeing: https://jsfiddle.net/qzf9c2vv/3/ |
@etimberg – Tried to see if this is still happening with the 2.0-beta branch, but I seem to be getting an error with the labels, so I'm guessing I'm doing something wrong here https://jsfiddle.net/phx2t0cc/5/ |
@lepinsk I updated to the latest from the v2.0-dev branch https://jsfiddle.net/jdvusk3y/1/ |
@etimberg Thanks – it looks like it is exhibiting the same behaviour from before, though, when the labels are longer: https://jsfiddle.net/jdvusk3y/2/ |
Yeah. #1731 was filed for that. It's pretty hard to fix since the tooltip needs to render on the canvas. I think I have an idea of what to do though to make it a little better but it involves some heavy refactoring |
Yeah, this seems like it'd be a headache. Just to confirm: I don't see anything in the docs about including a newline in a tooltip (and it doesn't seem like they're working when I try them out) – there's no way to do that, right? |
@lepinsk right now we don't explicitly split lines on newline characters. I don't think it would actually be that hard to add since we already have support for multiple line rendering. In the tooltip callbacks returning an array of strings renders each on its own line. |
Hello, today I am closing all issues that are only affecting version 1 of Chart.js as WONTFIX. If this issue does affect version 2 as well, I apologize for the error. Please create a test case against Chart.js 2 using on of the below websites and we will be happy to reopen the issue and update its classification: |
Hey, Looks like the issue is still present in Chart.js 2; longer tooltips aren't wrapping at the edge of the canvas, and it looks like newlines aren't working in them either? (I've tried Here's a codepen link: http://codepen.io/anon/pen/pbeJYL |
Wrapping all the issues for the tooltip overlap into the already existing #1731 |
Look at the two pictures, when the lable's length isn't enough, the edge of tooltip will be hidden.
Could you tell me how to resolve it?
The text was updated successfully, but these errors were encountered: