柱状图在我的胜利柱状图中穿过我的轴

问题描述

我正在使用Victory图表作为React Native中的一些条形图。我已经尽力而为,但是我遇到了一个问题,这是因为第一个小节通过了y轴标签。

示例:

enter image description here

我已经尝试使用domainPadding进行一些操作,但是它也影响了Y轴。有人知道如何正确设置标杆吗?

示例代码:

<VictoryChart padding={{top: 50,bottom: 0,left: 35,right: 125}} height={200}>
  <VictoryBar
    animate={{
      duration: 2000,onLoad: {duration: 1000},}}
    data={this.renderData()}
    barRatio={1}
    labels={['<30','30-60','60-90','>90']}
    style={{
      parent: {border: '2px solid black'},data: {fill: '#000',fillOpacity: 0.1},labels: {fill: 'white'},}}
    labelComponent={<VictoryLabel y={200} />}
  />
  <VictoryAxis
    dependentAxis
    style={{
      axis: {stroke: 'transparent'},ticks: {stroke: 'transparent'},tickLabels: {fill: '#FFF'},}}
  />
  <VictoryAxis
    crossAxis
    style={{
      axis: {stroke: 'transparent'},tickLabels: {fill: 'transparent'},}}
  />
</VictoryChart>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)