how to Yaxis at right side of chart in google chart api

1,433 views
Skip to first unread message

hassan

unread,
Apr 19, 2012, 12:42:22 PM4/19/12
to Google Visualization API
i m developing google chart api "area chart".

how to Yaxis at right side of the chart....
please help me.

asgallant

unread,
Apr 19, 2012, 1:16:40 PM4/19/12
to google-visua...@googlegroups.com
You can only have an axis on the right if the chart has more than one data series (as the left axis must have at least one data series assigned to it).

If you have more than one data series, then you can assign them to different axes using the 'series' option.  This option takes either an array of objects or an object with properties equal to the data series.  Set the 'targetAxisIndex' property of each data series object to assign them to one of the vAxes:

// assign the first data series to the left axis, and the next two data series to the right axis
series{
    0{targetAxisIndex0},
    1{targetAxisIndex1},
    2{targetAxisIndex1}
} 

The vAxes option takes either an array or an object with properties equal to the axis index; each element contains an object conforming to the vAxis option:

vAxes{
    0{
        title'left axis'
    },
    1{
        title'right axis'
    }
}
Reply all
Reply to author
Forward
0 new messages