Passed back values of the event onmouseover

79 views
Skip to first unread message

Dmitry Loktev

unread,
Jun 10, 2012, 6:24:37 AM6/10/12
to Google Visualization API
Hi!

I am drawing a scatter plot and I would like to treat the onmouseover
event. In the API reference it says that the event passes back the row
and column indices of the corresponding data table element.

So, to handle the onmouseover event I create a handler function and
add a listener:

function handler (){

alert ("in the handler");

}

google.visualization.events.addListener(chart, 'onmouseover',
handler);

But how do I seize the returned values, i.g. the coordinates of the
point where the mouse have passed?

Dmitry

visigoth

unread,
Jun 11, 2012, 5:18:05 AM6/11/12
to google-visua...@googlegroups.com
Hi,

The onmouseover event does not carry the coordinates of the cursor, only the indices of the element in the data table.
We are considering adding it in a future release, but as of yet have no estimation on when.

Visigoth

Dmitry Loktev

unread,
Jun 11, 2012, 5:21:50 AM6/11/12
to google-visua...@googlegroups.com
Thank your for the reply!

Actually I am interested not in the coordinates of the mouse, but in the coordinates of the hovered point. Sorry for the bad explanation in the first letter.
 
Is there a way to get them, i.g. the coordinates of the hovered point?

Dmitry!

2012/6/11 visigoth <visi...@google.com>

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/-yh3xKCMt0YJ.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

visigoth

unread,
Jun 11, 2012, 6:10:38 AM6/11/12
to google-visua...@googlegroups.com
I'm afraid there isn't.
We have an experimental API for both (coordinates of visual elements and the cursor), but this is not yet ready for public use.
Obviously if and when we decide to proceed and publish it there will be a proper announcement.

Sorry.
2012/6/11 visigoth <visi...@google.com>

To post to this group, send email to google-visualization-api@googlegroups.com.
To unsubscribe from this group, send email to google-visualization-api+unsub...@googlegroups.com.

Dmitry Loktev

unread,
Jun 11, 2012, 6:37:52 AM6/11/12
to google-visua...@googlegroups.com
I am always not sure if i've expressed myself correctly asking this question, because it seems that there is an answer (just found it!). That's a handler that treats the onmouse event, i.g. the event that fires when we hover a point.

function handler (e){

       
            alert ("in the handler");
           
      var a, b;
      a = data.getValue(e.row, 0);
      b = data.getValue(e.row, 1);
      alert('The user selected ' +  a + '  ' + b + 'coordinates ')
        }

Or is it the experimental API you were talking about?

Dmitry

2012/6/11 visigoth <visi...@google.com>
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/IoAJ4mTDPtwJ.

To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.

visigoth

unread,
Jun 11, 2012, 7:12:25 AM6/11/12
to google-visua...@googlegroups.com
I see now - I misunderstood what you meant by coordinates. I was sure you were referring to the screen (pixel) coordinates.
If you're interested in the data values then of course you can extract them from the data table using the row/column indices carried by the event.

The experimental API I was talking about refers to exposing the screen coordinates of the elements, not the data values.
2012/6/11 visigoth <visi...@google.com>
2012/6/11 visigoth <visi...@google.com>
To unsubscribe from this group, send email to google-visualization-api+unsubscr...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.
Reply all
Reply to author
Forward
0 new messages