BarChart with logScale doesn't display correctly when the number is float

47 views
Skip to first unread message

JJ

unread,
Oct 10, 2012, 7:05:48 AM10/10/12
to google-visua...@googlegroups.com
I have a BarChart that displays float numbers (0.9, 12.3, 125.7 etc), when I set it to use logScale the 0.9 value is displayed incorrectly - all bars starts from 1.0 at the horizontal axis and the 0.9 is displayed backward, meaning it starts from the 1.0 and goes towards the 0.0

Am I doing something wrong?
I tried to set the min and max values but it did not help.

Thank you,
JJ

Sergey Grabkovsky

unread,
Oct 10, 2012, 10:23:00 AM10/10/12
to google-visua...@googlegroups.com
Hi, I'm not sure I understand the question. Can you post a screenshot of the bug?

- Sergey




--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/dDEKfQk7Ex8J.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

asgallant

unread,
Oct 10, 2012, 10:50:09 AM10/10/12
to google-visua...@googlegroups.com
It shows as negative because log(0.9) is negative (the charts are drawn based on the log value and then the axes are labeled based on the raw value, thus the baseline is labeled 1 when it is actually 0).  You can move the baseline below 1 by setting hAxis.baseline to some number less than 1, but you can't actually get it to be 0.  Experiment with setting the baseline to negative powers of 10 (0.1, 0.01, 0.001, etc) until you find one that draws your chart the way you want it.

JJ

unread,
Oct 12, 2012, 3:34:53 AM10/12/12
to google-visua...@googlegroups.com
I played with the different options as you suggested and it seems that setting 'baseline: 0.1' did the trick and had the least side effects.

Thank you,
JJ
Reply all
Reply to author
Forward
0 new messages