Google chart Ticks

662 views
Skip to first unread message

Satender Siwach

unread,
Feb 18, 2018, 11:39:13 PM2/18/18
to Google Visualization API
Can anyone tell me how google charts calculate ticks intervals?
eg. if max value is 8.6 then it set 10 and ticks are [0,2.5,5,7.5,10]

Daniel LaLiberte

unread,
Feb 19, 2018, 2:01:25 PM2/19/18
to Google Visualization API
The algorithm used to calculate ticks is changing.   The 'upcoming' version uses a more uniform  (less heuristic) process that will hopefully work out better in most cases, so I am curious if it works for you.  To try it, just change 'current' to 'upcoming' in your load call.

In general, it tries to find the largest set of ticks that are spaced (on the screen) larger than the minimum spacing, and that follow the other constraints of being multiples of a set of possible alternatives.  The data range is first expanded by some percentage set by the maxPadding option, unless you have specified a viewWindow min or max, or used the viewWindowMode 'maximized' option.  

See the announcement about the upcoming changes here:   https://developers.google.com/chart/interactive/docs/release_notes#upcoming



On Sun, Feb 18, 2018 at 11:39 PM, Satender Siwach <satende...@gmail.com> wrote:
Can anyone tell me how google charts calculate ticks intervals?
eg. if max value is 8.6 then it set 10 and ticks are [0,2.5,5,7.5,10]

--
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+unsubscr...@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/f67ec729-4c78-4e78-a8ea-340d0173ca9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages