如何在Google Chart中设置Axis步骤? [英] How to set Axis step in Google Chart?

查看:154
本文介绍了如何在Google Chart中设置Axis步骤?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在使用JavaScript构建的Google图表中设置轴步骤?
我用它来设置最小值和最大值:

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
    },
}

我需要添加一个其他约束来将垂直步长修复为0.1,例如。

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

推荐答案

最后我发现了一个技巧:

Finally I found a trick using :

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

它没有设置步骤,而是告诉它

It don't set steps but instead, tell that


max /(nb steps)= count (这里 10

例如,max设置为 180 ,每个步骤使用计数值 18 :10

So for example with max set to 180, each steps will have a value of 18 using count: 10.

这篇关于如何在Google Chart中设置Axis步骤?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆