Hi,
What you are trying to do is possible, but you had a small yet significant
mistake that caused it not to work.
The setSelection method accepts an array of selections, while the event is
fired with a single hover entry.
All you have to do then is to surround the event with an array notation and
it will work:
google.visualization.events.addListener(visualization, 'onmouseover',
function(e) {
visualization.setSelection(*[**e**]**)*;
});
Make sure that you refer to the chart var in the same name in all places,
and that they are accessible. I think there is a mistake in the example you
wrote here, and in my code its 'visualization').
Regards,
VizGuy
On Wed, Aug 19, 2009 at 4:27 PM, Savageman <[email protected]> wrote:
>
> Still looking for help.
>
> The problem is that the onmouseover returrns a selection and not an
> event.
> Is there any way to get a second parameter? Or something like
> google.vizualisation.events.lastevent?
>
> Thanks!
>
> On 14 août, 18:05, Savageman <[email protected]> wrote:
> > Hi,
> >
> > Thanks for the Visualisation API, it really rocks.
> > I'm using AreaChart and I'm trying to display some tooltips when
> > hoverint the points on the graph.
> > Unfortunately, the onmouseover() callback function returns only a
> > selection ({row:1,column:2} for example) and I couldn't get the event
> > to retrieve the mouse position...
> >
> > Here is some code:
> >
> > var areachart = new google.visualization.AreaChart
> > (document.getElementById('chart_div'));
> > areachart.draw(data, {});
> > google.visualization.events.addListener(areachart, 'onmouseover',
> > function(sel) {
> > area.setSelection(sel); // 1st question: this code
> doesn't select
> > anything (no tooltip on the graph), why?
> > // 2nd question: how to retrieve the object event?
> window.event is
> > undefined here, don't know why...
> > });
> >
> > Thanks for help !
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---