Line chart redraw animation type

42 views
Skip to first unread message

Samuel Kelemen

unread,
Oct 17, 2017, 3:01:48 AM10/17/17
to Google Visualization API
It is possible to tell graph to redraw lines with "drift" animation when i pass new DataTable to chart? Sometimes it redraws lines with drift but sometimes it only raise points up/down. I am trying to implement slide action with ajax data load and when chart radraws without drift animation users are often lost.

Samuel Kelemen

unread,
Oct 17, 2017, 9:05:14 AM10/17/17
to Google Visualization API
Ok i "hack it", first i add only new points without change viewWindow and redraw chart. After first redraw i redraw chart with all new data and chart animate everytime with "drift" animation.

Dňa utorok, 17. októbra 2017 9:01:48 UTC+2 Samuel Kelemen napísal(-a):

Daniel LaLiberte

unread,
Oct 17, 2017, 9:07:04 AM10/17/17
to Google Visualization API
I was about to suggest the same as you just discovered.  While there is no option to control how the animation is done, you can affect the animation by how you change your data.  There is an optimization that detects when your data has the same number of rows before and after, in which case it does the in-place up/down type of animation, and otherwise, it does the more expensive calculation to find nearest values.  So if you want the latter behavior, just arrange that you only add rows or remove rows, or at least end up with a different number of rows at each step.

--
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-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@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/ed1411eb-754a-4ece-80c6-bbb04ee820e4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages