Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Axis step in Google Chart?

I'm wondering how to set axis step in a google chart built from JavaScript? I use this to set min and max:

vAxis: {
title: 'temps (ms)',
    viewWindowMode: 'explicit',
    viewWindow: {
        max: 180,
        min: 0
    },
}

And I need to add an other constraint to fix vertical step to 0.1 for example.

like image 825
alain.janinm Avatar asked Feb 01 '12 23:02

alain.janinm


1 Answers

You can do it with ticks:

vAxis: {
    title: 'temps (ms)',
    viewWindow: {
        min: 0,
        max: 180
    },
    ticks: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180] // display labels every 10
}
like image 156
Paul Chris Jones Avatar answered Sep 28 '22 08:09

Paul Chris Jones