无法在Google条形图中自定义不同的Y轴

时间:2017-12-11 16:09:52

标签: javascript charts google-visualization

我的谷歌图表由条形图和散点图组成,因此我使用两个不同的Y轴。

我无法为每个Y轴指定不同的选项。

{
    vAxis: {
      /* not taken into account... */
      0: {
        title: 'Y Left Axis',
        format: '#'
      },
      1: {
        title: 'Y Right Axis',
        format: '#'
      }
    },
    seriesType: 'bars',
    series: {
      4: {
        type: 'scatter',
        targetAxisIndex: 1
      },
      5: {
        type: 'scatter',
        targetAxisIndex: 1
      }
    },
    isStacked: true,
    legend: {
      position: 'none'
    }
}

如果我像下面那样设置vAxis,它将对两个轴使用相同的格式和相同的标题......

vAxis: {
  format: '#',
  title: 'Same title will be used for the two axis...'
}

1 个答案:

答案 0 :(得分:0)

没有详细记录但是来自this page,我必须使用vAxes而不是vAxis

相关问题