首页 > 解决方案 > 是否可以将 y 轴标签复制到谷歌图表的右侧?

问题描述

有没有人对谷歌图表有一些经验,之前遇到过类似的问题?我基本上需要在图形的两侧显示相同的 y 轴标签,如图所示: 图形的图像

这是我的数据集:

['Date', 'Drilling', 'Stacked', 'Cold stacked', 'Construction', 'Repair']
['2020-09-16', 406, 171, 135, 67, 3]
['2020-09-17', 407, 170, 135, 67, 3]
['2020-09-18', 408, 169, 135, 67, 3]
['2020-09-19', 408, 169, 135, 67, 3]
['2020-09-20', 409, 168, 135, 67, 3]
['2020-09-21', 408, 169, 135, 67, 3]
['2020-09-22', 406, 171, 135, 67, 3]
['2020-09-23', 407, 170, 135, 67, 3]
...and so on...

和图表设置:

{
  isStacked: true,
  colors: ['#ff4852', '#005BFF', '#FFAB2E', '#af5ddf', '#00A580'],
  vAxis: {
    format: '######',
  },
  chartArea: {
    top: '30',
    height: '75%',
    width: '80%',
  },
  series: {
    0: {
      textPosition: 'none',
    },
  },
  vAxes: {
    1: {
      textPosition: 'none',
    },
  },
  hAxes: {
    0: {
      gridlines: { color: 'transparent' },
    },
  },
}

标签: javascriptcharts

解决方案


推荐阅读