explorer option - use both dragToPan and dragToZoom on LineChart

492 views
Skip to first unread message

Santiago Acosta

unread,
Apr 14, 2016, 6:37:11 AM4/14/16
to Google Visualization API
I understand that there is a very powerful dashboard alternative to what I want to ask but I can't rely on the dashboard for now.

There is a couple of settings in the explorer option that are technically mutually exclusive: dragToPan and dragToZoom. They both have overlapping behavior but both can be activated at the same time and cause some pretty strange effects.

In my current implementation I am looking for a way to swap between both behaviors.

 - Detect that the user has zoomed into the chart, swap out dragToZoom for dragToPan+rightClickToReset
 - Allow the user to move around and then reset the chart, swap out dragToPan+rightClickToReset for dragToZoom

It is my current understanding that there is no specific event to listen for when a user has zoomed in. I have tried to listen for changes in the view window to no avail.

Would there be any way to implement this functionality in the current version of the API?

Is there a way to detect a dragToZoom?

Is there a reliable way to detect an onmousedown-onmouseup event that would trigger the zoom?

Daniel LaLiberte

unread,
Apr 14, 2016, 3:57:26 PM4/14/16
to Google Visualization API
Hi Santiago,

Sorry, we don't have events for when the redrawing finishes due to explorer actions.  We should.  I'm not sure about detecting the mouse events on the containing div for the chart, but that sounds doable.  You could use that to watch for when the chart changes by repeatedly looking at the chart area layout with chart.getChartLayoutInterface(). Documentation in each chart:  https://developers.google.com/chart/interactive/docs/gallery/linechart#methods


--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/cab636aa-22a5-4390-a5e5-810f92b209d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages