Here's one way to do it: http://jsfiddle.net/asgallant/kb6gY/

If your table is large, I don't recommend that you use this method, as it 
creates an individual event handler for each cell.  There is a more 
efficient way of doing this: use a single event handler on the table, parse 
the event.target/event.srcElement to figure out what is being moused over, 
and then fire the alert when appropriate.  Writing a script to do that is 
far more complicated, however, and can get even more complicated if you 
allow HTML in your table cells.

On Thursday, December 5, 2013 5:51:23 AM UTC-5, min ji wrote:
>
> Thank you, asgallant! could you please give me a detail example?
> Here are the codes. when the function onmouseover is fired, a messagebox 
> will be show: i eat ***. how to write it?  thank you very much!
> function drawVisualization() {
>  
>   var data = google.visualization.arrayToDataTable([
>     ['MON', 'TUE', 'WED','THUR', 'FRI', 'SAT'],
>     ['apple', 'banana', 'melon','apple', 'banana', 'melon'],
>   
>   ]);
>
>  
>   visualization = new google.visualization.Table(document.getElementById(
> 'table'));
>   visualization.draw(data, null);
> google.visualization.events.addListener(myTable, 'ready', function () {
> // set up mouse event handlers on table elements
> });
> }
> 
>
> On Thursday, December 5, 2013 5:49:05 AM UTC+1, asgallant wrote:
>>
>> The Table visualization does not throw mouse events, so you have to set 
>> them up yourself using standard javascript.  You should set them up inside 
>> a "ready" event handler for the table to ensure that the table elements 
>> exist when you create the events.
>>
>> google.visualization.events.addListener(myTable, 'ready', function () {
>>     // set up mouse event handlers on table elements
>> });
>>
>> On Wednesday, December 4, 2013 4:26:01 PM UTC-5, min ji wrote:
>>>
>>> hi,
>>> i want to add a onmouseout function to a table. i add listener  but it 
>>> cannot work. anybody knows how to use it? An example will be better.
>>> thank you!
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to