简体   繁体   English

Google Charts 禁用右侧的 y 轴

[英]Google Charts disable y-axis to the right

How do I disable y-axis to the right, so all columns will use y-axis to the left?如何禁用右侧的 y 轴,以便所有列都使用左侧的 y 轴?

Y轴右

Options code:选项代码:

var options = {
   stacked: true,
   series: {
        2: { axis: 'counter1' }
   }
};

JSFiddle: https://jsfiddle.net/kn4hcjww/2 JSFiddle: https://jsfiddle.net/kn4hcjww/2

Thanks in advance.提前致谢。

Replying late but someone will find it usefull anyway.回复晚了,但无论如何有人会发现它很有用。

Each series is pointing to targetAxisIndex.每个系列都指向 targetAxisIndex。 Axis index 0 is at left side of y-axis.轴索引 0 位于 y 轴的左侧。 Higher indexes are sided to right by default.默认情况下,较高的索引是向右的。

Solution解决方案

Config the targetAxisIndex to zero index.将 targetAxisIndex 配置为零索引。

 series: { 0: { targetAxisIndex: 0, }, 1: { targetAxisIndex: 0, }, };

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM