Center tooltip properly

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 John on 2nd January 2013
Hi,

I've created a graph which includes tootips. A tooltip consists of a list of strings and could be very long in both width and lengh. When I click on a bar the tooltip appears, but sometimes I cannot read the content, because the tootips appears out of the browser window to the left. Is there a method or function to prevent this and tell the tooltip where to appear?

Any ideas?


Cheers,
John

My code (implemented in a python script)

graph = "<canvas id='" + canvas_name + "' width=""600"" height=""250"">[No canvas support]</canvas>"+\
             "<script src=\"/moin_static193/common/libraries/RGraph.common.dynamic.js\"></script>"+\
      "<script src=\"/moin_static193/common/libraries/RGraph.common.tooltips.js\"></script>"+\
      "<script src=\"/moin_static193/common/libraries/RGraph.line.js\"></script>"+\
      "<script>"+\
             " var bar = new RGraph.Bar('" + canvas_name + "'," + data_array + ");"+\
             " bar.Set('chart.labels', " + label_array + ");"+\
      " bar.Set('chart.tooltips', " + tooltip_array + ");"+\
      " bar.Set('chart.tooltips.effect', 'fade');"+\
       " bar.Set('chart.tooltips.event', 'click');"+\
      " bar.Set('chart.tooltips.coords.page', true);"+\
             " bar.Set('chart.gutter.left', 45);"+\
             " bar.Set('chart.background.barcolor1', 'white');"+\
             " bar.Set('chart.background.barcolor2', 'white');"+\
      " bar.Set('chart.labels.above', true);"+\
       " bar.Set('chart.background.grid', true);"+\
      " bar.Set('chart.colors', ['blue']);"
Posted by RGraph support on 3rd January 2013
Hi,

There's no function or method, but tooltips are regular HTML DIV tags, so you can use HTML tags in them, such as <br /> to break up the content.


PS If you could link to the RGraph website I'd appreciate it - thanks.

Richard, RGraph Support

Add a reply




« Back to message list