-
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
Tooltips #51
Tooltips #51
Conversation
Awesome 👍 |
When is this planned to be merged into master? |
Are you planning to extend this so that no special area needs to be configured but tooltip is automatically shown when the mouse hovers over a diagram shape? |
Currently the tooltip appears when the user hovers:
For other chart types the tooltip registration has to be done manually when programming the rendering algorithm. |
sounds cool, thanks! |
I just couldn't get the tooltips to work on a Doughnut chart. Can you post some example code for it? |
I am just wondering if this feature has already been merged in place with the current branch? |
i'm using the latest version Version 31.0.1650.63 m |
Yeah me too. It works on my page. Did you test it @mouhsinelonly ? |
Chrome 32.0.1700.68 beta - doesn't work. |
@alternativshik did you test my version here -> http://github.wikunia.de/Table2Chart/ It work works for 31.0.1650.63 m |
@Wikunia yes your version works in chrome. |
@mouhsinelonly I've add this jhdavids8@194261a commit from @jhdavids8 in my version! |
tested the commit but with no luck !! still the same probleme in chrome 2013/12/27 Ole Kröger [email protected]
*Mouhsine Bakhich * ,Developper Trans Gulf For Information Technology |
Oh that's strange I think I didn't change sth. else which can affect tooltips in Chrome ... |
@Wikunia There is a bug with this tooltip branch on Chrome 31, Nexus 7 (I think any android device, KitKat). Once the bar chart reaches almost 100% the canvas fails to draw correctly (the bars disappear and the scale is only visible in the bottom-part of the canvas). This problems does not occur on the Chart.js homepage demo. See my SO question: http://stackoverflow.com/questions/20767973/chart-js-disappears-on-android |
@Cristy94 and I realized that the problem is only for the bar chart, so there is no problem with the stacked bar chart. Let me see... :D |
Works in most browsers, except Chrome. I've tested it with Line and Bar charts, neither seem to work in Chrome. IE and FF work great. Tested Chrome version: 32.0.1700.107 The charts render fine btw (in all browsers)... |
Would have some estimate of when it will work in chrome? |
Must be something really silly about how the event is handled. Works in Safari but not Chrome, very odd. |
Okay I was able to make it work by taking the event out of the if/else that was using window.touch, so it has something to do with Chrome thinking window.touch is always on perhaps? I will look for a better way to write that if, but in the meantime you can just take the onmousemove call out of that if assuming you don't care about mobile. |
My theory is confirmed, http://stackoverflow.com/questions/18459747/chrome-29-window-touch basically window.Touch in chrome no longer returns undefined, so we have to do a better check for mobile touch devices. |
This makes Chrome work as expected:
I would push my changes but I've changed a bunch of other stuff today and I don't want to push those yet. |
Touch check is fixed in my latest master. |
@Regaddi - your latest master doesn't work for me at all in FireFox 27.0.1 |
@Strainy Minified or Non-Minified? |
@Regaddi - It seems both aren't working. |
@Strainy both are just fine for me with Firefox 27.0.1. |
@jhdavids8 I took your fork that has mouse events for Line points and added mouse events for Polar Area Charts. If anyone is interested, it's here. |
@Cristy94 Did you found a workaround/solution for this on Android by any chance? Experiencing the same thing here.. |
This is great! really really nice! Just have some questions. If I have multiple data on one chart. Is there a way to edit the template to its specific data? because right now, It only shows the x and y axis labels |
I have developped an alternative version of Chart.js that you will find on https://github.com/FVANCOP/ChartNew.js. The tooltips have been implemented in another way : in ChartNew.js, you have to specify option "annotateDisplay : true" to see the "hover" display. In this version, the display is fully configurable through option "annotateLabel" option. The value for the annotateLabel must be a "template" value (like the scaleLabel parameter described in Nick's version). Other options are also available to configure the "hover" displays (options starting with "annotate"). |
I implemented some basic tooltips, which show (if defined) the label and value onmouseover.
Every tooltip can be registered by a configurable area:
Tooltip Defaults can be overwritten by adding a 2nd parameter to the "new Chart()" function, i.e.
The following Tooltip options are available:
The tooltip moves relative to the current mouse cursor position and shows only, if hovering a valid chart point or area.
Tooltips can be disabled via specific chart option "showTooltips" i.g.
They can be styled individually and do right now a basic job:
Showing the hovered label and value.