胜利图表独立设置 x 轴和 y 轴标签的样式

Victory Chart style the x-axis and the y-axis label independently

我用的是胜利图,大致有以下代码

<VictoryChart domainPadding={30} {...commonProps}>
        <VictoryBar
          data={props.data}
          {...labelProps}
        />
  </VictoryChart>

我使用了 tickLabels 样式 {angle: 45},但是这在内部应用于 x 轴和 y 轴,我只希望 x 轴的倾斜文本,但如您所见,它也影响了y 轴,我该怎么做?

尝试在组件中指定两个轴并仅将样式应用于其中一个

<VictoryChart domainPadding={10}>
  <VictoryBar
    data={sampleData}
  />
  <VictoryAxis dependentAxis
    tickValues={[1, 2, 3, 4,5]}
  />
  <VictoryAxis
    tickValues={[1, 2, 3, 4,5]}
    style={{ tickLabels: {angle :45}}}
  />
</VictoryChart>