y-axis

38 views
Skip to first unread message

Jessica Schlapbach

unread,
Jan 5, 2016, 2:35:49 AM1/5/16
to Google Visualization API
hey hey,

I don't know if this is a bug of some sort, but the y-as of my chart is acting strange.
Everything works as I want it to except the y-axis.

This is the code for the y-axis that I use:
 
options.vAxis = {
title: title,
gridlines: {
count: 12,
color: '#939393',
},
viewWindowMode:'maximized',
viewWindow:{
max: vAxesMax.max,
min: vAxesMin.min,
},
}

This is what I want it to look like (this is achived by using the explorer option):
The explorer option should only be a feature which can be enabled and disabled by the costumer.

This is what it looks like (without the explorer option):
I don't want the numbers behind the comma, so I put a formater to the y-axis:
format: '#', OR format: '0',
which creates this grafiek (and here is the problem):

the grafiek is displayed 0.5 higher, then it should (look at the tooltip which says that min is 10 or at the explorer which has the correct y-axis).

I don't know if this is a bug or if I can fix it with some sort of code, I can also life with the numbers behind the comma (but they are not realy pretty for the grafiek that I am making :<).
I would realy like the y-axis without explorer to act like the one with explorer.

M.f.G.,

Jessica.

Daniel LaLiberte

unread,
Jan 5, 2016, 8:23:28 AM1/5/16
to Google Visualization API
Hi Jessica,

Your gridlines.count option being 12 is the problem, since the chart does try to accommodate your request. Note that the image that shows what you don't want does have 12 gridlines, while the image that shows what you do want has 14.  The other part of the problem is your assumption that the formatted tick labels will correspond accurately to your tick values.  You can format the labels to all be "foobar" and that's what you will get.

We should have a way of using the format to help determine the gridline values, but it's not available yet.

For now, you should either specify the gridlines.count to be -1, which means it will be automatically computed rather than defaulting to 5, and live with the occasional extra precision (which is more likely to be .5) or specify the 'ticks' option to get exactly the values you want.

--
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/5d1da47a-8b4e-4cd1-a9aa-c3227d30c7b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Jessica Schlapbach

unread,
Jan 8, 2016, 3:10:50 AM1/8/16
to Google Visualization API
Thank you very much I found the problem after you said that the explorer uses 14 gridlines. 
I thoughed I changed I set it to 14 gridlines, but i gues I also had format on at the same time. 
Without format it works as I want it to do, with a gridline count of 14.

Thank you ver much for your help.

Jessi. 
Reply all
Reply to author
Forward
0 new messages