multiple axes

88 views
Skip to first unread message

cd2012

unread,
Apr 2, 2012, 4:08:45 PM4/2/12
to google-visua...@googlegroups.com
Is there a way to plot ComboCharts with each series having its own x and y axis?
Thanks!

asgallant

unread,
Apr 2, 2012, 4:18:17 PM4/2/12
to google-visua...@googlegroups.com
I don't believe there is any way to make them have their own X-axis, but you can have two y-axes, using the series.targetAxisIndex and vAxes options.

cd2012

unread,
Apr 3, 2012, 1:41:57 PM4/3/12
to google-visua...@googlegroups.com
OK.
I guess my question more specifically is that when I plot multiple graphs on a ComboChart, can I plot them such that each series has its own set of values on the x-axis? The x-axis itself is common, but each x-axis value does not necessarily match for every single chart.
 
It is easy to specify values on the y-axis for each series that is being plotted, but I'm wondering if I can do that for the x-axis as well.
 
Thanks for the help!

asgallant

unread,
Apr 3, 2012, 2:09:53 PM4/3/12
to google-visua...@googlegroups.com
Yes, you can have "holes" in your data where a given series has no values assigned; ex, if you have two series, your DataTable can look like this:

​var data new google.visualization.DataTable();
data.addColumn('number''X');
data.addColumn('number''Y1');
data.addColumn('number''Y2');

data.addRows([
    [015],
    [14null],
    [239],
    [3null4],
    [482]
]); 

Y2 would have no data for X=1 and Y1 would have no data for X=4.
Reply all
Reply to author
Forward
0 new messages