Floating point precision in y axis?

640 views
Skip to first unread message

Wells Oliver

unread,
Oct 14, 2012, 10:50:52 PM10/14/12
to google-visua...@googlegroups.com
Is it possible to specify the precision of floating point values in graph axes? I'd like the values shown to three points but I can't seem to force this.

Thanks.

asgallant

unread,
Oct 15, 2012, 12:53:26 AM10/15/12
to google-visua...@googlegroups.com
Set the vAxis or hAxis's (depending on which you want to format) format property to something like "#.###", ie:

vAxis{
    format'#.###' // show axis values to 3 decimal places

Wells Oliver

unread,
Oct 15, 2012, 1:07:46 AM10/15/12
to google-visua...@googlegroups.com
Thanks. It's odd, but '#.###' does not work, yet '0.000' does work.

Wells Oliver

unread,
Oct 15, 2012, 1:10:43 AM10/15/12
to google-visua...@googlegroups.com
Also: is there a way to set the floating point precision for the values shown in the tooltip?

asgallant

unread,
Oct 15, 2012, 1:47:49 AM10/15/12
to google-visua...@googlegroups.com
Sorry about that - the one I posted will restrict to 3 significant figures, but it won't force them when the value wouldn't use them normally.

To format the tooltips, use a NumberFormatter on the DataTable column.  You can use the same format pattern.
Reply all
Reply to author
Forward
0 new messages