The tick values are currently chosen regardless of the format, and then the
format is imposed on the chosen values.  So, to handle numbers smaller than
1, you would want a format like '#.##'.

If you only have 0 values in your data (or only one single value), then the
chart doesn't know how to scale the axis, so it chooses arbitrarily.  But
you can override this by specifying a viewWindow option for the axis with
min and max values.  You could also specify minValue and maxValue to get
the same effect in this case.

The best way to get exactly the ticks that you want, with the formatting
you want, is to specify the ticks option.  E.g. vAxis: { ticks: [ 0, 1, 2,
3, 4, 5 ] }  Each value could be replaced by an object to specify both the
value and the formatted representation.  For example, if one of your tick
values was 1/3, you could put this in your ticks array: { v: 1 / 3, f:
'0.33' }.


On Tue, Jan 19, 2016 at 3:06 AM, <[email protected]> wrote:

> Daniel, thank you, it partially did the work for me.
> I have these charts to show positive integer values.
> I was using the format: '#' option but was giving problems when the
> y-values were in a range smaller than 5 ( e.g. I had only values '0' '1'
> '2' )  as the chart showed doubled ticks (0, 1, 1, 2, 2).
> The option you give   gridlines: { count: -1}   solve the issue, but
> another one comes out: if I have only 0s  the chart shows y-grids   '-1'
> '0'  '1'.
>
> Is there any way to have both issues fixed (only integer, not-doubled
> grids  AND only positive values ) ?
>
> Thomas
>
> --
> 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 [email protected].
> To post to this group, send email to
> [email protected].
> 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/4ae45e9b-3ef8-4580-b19e-9c86a58faee0%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/4ae45e9b-3ef8-4580-b19e-9c86a58faee0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   5CC, Cambridge MA

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAOtcSJN_r-69ift_b73Mtp8RTtBKQZMK8gsC9s%2BHqwryxJD_iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to