Hi Adam.

A tooltip can be opened by a click on a bar or by using the setSelection()
method of the visualization. The setSelection method is documented
here<http://code.google.com/apis/visualization/documentation/reference.html#vissetselection>
and
it is very easily used with the visualization onmouseover and onmouseout
events<http://code.google.com/apis/visualization/documentation/reference.html#events>
in
order to create the effect you requested.

Here is a short code snippet that causes the tooltip to open/close when the
mouse hovers/exists a bar:

*    function drawVisualization() {*
*      visualization = new
google.visualization.ColumnChart(document.getElementById('table'));*
*      visualization.draw(data, null);*
*
*
*      // Add our over/out handlers.*
*      google.visualization.events.addListener(visualization, 'onmouseover',
barMouseOver);*
*      google.visualization.events.addListener(visualization, 'onmouseout',
barMouseOut);*
*    }*
*
*
*    function barMouseOver(e) {*
*      visualization.setSelection([e]);*
*    }*
*
*
*    function barMouseOut(e) {*
*      visualization.setSelection([]);*
*    }*

best,
  MC Get Vizzy

On Sun, Aug 30, 2009 at 7:23 PM, Adam <[email protected]> wrote:

>
> Hi,
>
> Currently the only way to show a tooltip is to click on a bar.
>
> I want a tooltip (or floating div) to appear automatically next to the
> mouse cursor whenever the mouse cursor hovers over each bar.
>
> In order to do this I need the mouse cursor position but the
> onmouseover and onmouseout chart events do not supply these values.
>
> I would appreciate any help you can give me on this issue.
>
> thanks in advance,
> Adam.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to