问题描述:

Say I have a chart like this:

https://i.stack.imgur.com/iKgI0.png

I'd like the label for max x-axis value (currently 150) to always read 120 (the actual bar value will never exceed this)

I've tried a few different configuration options and unable to achieve what I'm looking for

网友答案:

try adding the following to the chart options...

hAxis: {
  viewWindow: {
    max: 120
  }
}

fyi:

this option is not available for use with material charts...

google.charts.Bar

with

packages: ['bar']


as an alternative to material, you can use core chart...

google.visualization.BarChart

with

packages: ['corechart']

with the following option...

theme: 'material'

相关阅读:
Top