{{ target: component-y-axis }}

yAxis(Object)

直角坐标系 grid 中的 y 轴,一般情况下单个 grid 组件最多只能放左右两个 y 轴,多于两个 y 轴需要通过配置 offset 属性防止同个位置多个 Y 轴的重叠。

{{ use: partial-component-id( prefix = “#” ) }}

show(boolean) = true

是否显示 y 轴。

gridIndex(number) = 0

y 轴所在的 grid 的索引,默认位于第一个 grid。

alignTicks(boolean) = false

{{ use: partial-version( version = “5.3.0” ) }}

在多个 y 轴为数值轴的时候,可以开启该配置项自动对齐刻度。只对'value''log'类型的轴有效。

position(string)

y 轴的位置。

可选:

  • 'left'
  • 'right'

默认 grid 中的第一个 y 轴在 grid 的左侧('left'),第二个 y 轴视第一个 y 轴的位置放在另一侧。
注:若未将 yAxis.axisLine.onZero 设为 false , 则该项无法生效

offset(number) = 0

Y 轴相对于默认位置的偏移,在相同的 position 上有多个 Y 轴的时候有用。
注:若未将 yAxis.axisLine.onZero 设为 false , 则该项无法生效

需要配合其他配置项共同实现动态排序柱状图效果,具体参见动态排序柱状图教程。

{{ use: axis-common( prefix = ‘#’, componentType = ‘yAxis’, axisTypeDefault = “‘value’”, hasSplitLineAndArea = true ) }}

{{ use: partial-z-zlevel( prefix = “#”, componentName = “Y 轴”, defaultZ = 0 ) }}