multiple vaxies relate to one serie

47 views
Skip to first unread message

Ji Joe

unread,
Aug 26, 2012, 10:04:31 PM8/26/12
to google-visua...@googlegroups.com
Hi,I'm a beginner of google chart tools.
I have a problem that i need to peform some financial datas in the chart .And the left vaxis shows the real number and the left vaxis shows it's percent of the total .
I think the two vaxies should share the same series,but i dont know how to do.
thanx.

asgallant

unread,
Aug 26, 2012, 10:22:20 PM8/26/12
to google-visua...@googlegroups.com
You can't have two y-axes running off the same data, but you can convert your single data series into two data series (one with the base data and one with the base data converted to percentages).  Assign one to the left axis and one to the right axis using the series.<seriesIndex>.targetAxisIndex option.  You can then configure the two vAxes using the vAxes.<axisIndex> option (which takes sub-options like the vAxis option).  I can do up an example tomorrow if you need one.

Ji Joe

unread,
Aug 26, 2012, 10:44:13 PM8/26/12
to google-visua...@googlegroups.com
gratitude!you means that separate one data into two series,one is to right  and one is to left ,and hide one serie?But how to make them perform like one.I really need your example ,thank you a lot !
I also have another question whether it possible. i want a vaxis whose  texts' colors are different .For example ,if the scale is bigger than zero ,the color of the text in the vaxis is red,on the contrary ,the color is green.
Can it be possible ?
Thank you for your help. 

在 2012年8月27日星期一UTC+8上午10时22分20秒,asgallant写道:

asgallant

unread,
Aug 27, 2012, 12:19:50 PM8/27/12
to google-visua...@googlegroups.com
As long as your transformation into percents is a linear function and not based off of something else, and there is nothing else (like a third series) to influence the axis ranges, then the two series should draw overlapped one on top of the other.  See an example here: http://jsfiddle.net/asgallant/qUFLP/ 

As far as coloring the axis labels, you can't change color by value.
Reply all
Reply to author
Forward
0 new messages