Google注释图表:是否可以反转Y轴?

时间:2016-02-12 05:51:29

标签: charts annotations google-visualization

我正在使用需要Google Annotation Chart来显示我的数据的项目。我有一个像下面这样的问题。

我的问题: 我想在Y轴上显示反向值。 我的意思是:值越大,反之亦然(值越小)

我尝试在支持文档中测试所有选项,但它仍然无效 https://developers.google.com/chart/interactive/docs/gallery/annotationchart

选项:

...
 vAxis: {direction: -1} // This works on line chart but not annotation chart
...

或像

这样的事情
...
max: -200000, // this won't work and it's just keep the value not minus
min: 200000
...

这是我从文档页面分叉的测试代码 https://jsfiddle.net/lecaoquochung/dsmgL9wj/2/

有人可以帮我解答我的问题吗? (现在和以后可以反转Y轴吗?)

非常感谢

1 个答案:

答案 0 :(得分:1)

问题解决了。我更新了testcode图表

解决方案:将图表添加到选项中(获取Googler的支持)

 chart : {vAxis: {direction: -1}},
  • 备注:不知道API或语法中的更新内容(因为图表文档页面上没有图表选项说明)

希望这对任何人遇到同样问题的帮助。