Google Charts Visualization Column Chart axis formatting and column colors

前端 未结 8 1029
不知归路
不知归路 2020-12-25 15:17

\"chart\"

I have this Column Chart using Google\'s Visualization Chart API tools. How would I make it so the y-

8条回答
  •  -上瘾入骨i
    2020-12-25 15:26

    Positive numbers:

    You can use vAxis.minValue to set the lowest y-axis gridline, however the actual value of the gridline will be the minimum of what you set and the lowest value in your data, so if you have 0 in your data (as it seems you do for Unsatisfactory), this value will be used for the lowest y-axis gridline.

    Whole numbers:

    http://groups.google.com/group/google-visualization-api/browse_thread/thread/04a001766367dc0f/84c34338c2808069 - this is an older post, but as there is nothing in the chart API documentation, it seems the functionality to specify whole numbers only is still lacking.

    Because the chart defaults to 5 gridlines (this is what you'd like to be able to override), if your highest data value is 2.0 (like in the example) you could force whole numbers by setting vAxis: {maxValue: 5}, although this may not be the most elegant solution.

提交回复
热议问题