如何从 google 图表中删除 y-axis 值

How to remove y-axis values from google chart

我正在使用 google 个图表。

在附图中,我不想显示 100、50、0、-50、-100 数字。但我确实希望显示满意度标签。有谁知道如何在 google 图表中实现这一点? vAxis 上有选项吗?

另一个(不太重要的)问题是我只想要 100、0 和 -100 处的网格线。其他6个我不要了。

我目前设置了以下选项...

var options = {
    chartArea: { width: '80%' },
    colors: ['#00ff00', '#ff0000'],
    vAxis: {
        title: 'Satisfaction',
        maxValue: 100,
        minValue: -100,
        gridlines: { count: 2 }
    },
    legend: { position: 'bottom' }
};

谢谢。

使用以下 vAxis 选项...

textPosition: 'none'

请参阅以下工作片段...

google.charts.load('current', {
  packages: ['corechart']
}).then(function () {
  var data = google.visualization.arrayToDataTable([
    ['x', 'y0', 'y1', 'y2'],
    [0, 10, 12, 18],
    [2, 16, 18, 19],
    [4, 18, 19, 24],
    [6, 26, 28, 22],
    [8, 13, 15, 21],
    [10, 32, 31, 33]
  ]);

  var options = {
    chartArea: { width: '80%' },
    colors: ['#00ff00', '#ff0000'],
    vAxis: {
      textPosition: 'none',
      title: 'Satisfaction',
      maxValue: 100,
      minValue: -100,
      gridlines: { count: 2 }
    },
    legend: { position: 'bottom' }
  };

  var chart = new google.visualization.LineChart(document.getElementById('chart'));
  chart.draw(data, options);
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart"></div>