Re: Different y-axis values

45 views
Skip to first unread message

asgallant

unread,
Nov 29, 2012, 11:05:08 AM11/29/12
to google-visua...@googlegroups.com
Yes, you can do that.  The vAxes option takes two objects as it's parameters, each of which takes the same suboptions as vAxis.  vAxes.0 controls the left y-axis, and vAxes.1 controls the right axis.  The x-axis should take care of itself, as long as you are using a "timeofday" type column in your DataTable.  You can set hAxis.format to change how the time is displayed.  Here's an example of what those options might look like for you:

var foo {
    hAxis{
        format'hh:mm a' // 03:47 PM
    },
    vAxes{
        0{
            // left y-axis options
            format'#\u00B0C'// 23°C
            minValue10,
            maxValue30
        },
        1{
            // right y-axis options
            format'#%'// 0.34 -> 34%
            minValue0,
            maxValue1
        }
    }
}

All of the configuration options are explained here.

On Thursday, November 29, 2012 9:46:11 AM UTC-5, Tomáš Hora wrote:
Hello everyone!

Example: I have x-axis representing time of day, and on the left side of a LineChart I want to have temperature (10 - 30°C) and on the right side I want to have percentage of power of a unit ( 0 - 100%). Is it possible to achieve this using google charts (HOW?)? Thanks a lot i advance!
Reply all
Reply to author
Forward
0 new messages