Is it possible to have tooltips on labels?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Jan Dirk on 31st August 2016
Hello Richard,

In my charts I set textAccessibleOverflow=true
This way the labels will not cross the boundaries of the canvas.

However, my labels are quite often pretty long and are therefore truncated. (I calculate dynamically the gutter-sizes and give up to 40% of the canvas width to the left-gutter).
At the moment I use CSS to make sure the labels are not truncated when the canvas is hovered, and make them 'completely' visible in that case.

However, this is still not what I really would like to see, because:
- when the canvas is located at the left side of the screen, the text still falls out of the screen.
- when there is something (like another graph) left of this canvas, the text is shown over that other thing.

Is there already a way to be able to specify shorter labels and have some kind of tooltip to show the longer version of the labels?

Regards,

Jan Dirk
Posted by Richard on 31st August 2016
Hi there,

I can think of two ways to do this right off the bat, and this is the simpler I think:

www.rgraph.net/tests/bar-tooltips-labels.html

It uses title attributes that are added to the text nodes. Naturally it relies on you using accessible text (which is the default on recent releases of RGraph).

The appearance of the tooltips is dependent on the system, but most of the time they're little yellow boxes.



Richard

Add a reply

 




« Back to message list
RGraph on social media