BarChart中的网格组件在iOS上不起作用(react-native-svg-charts)

时间:2019-08-27 11:20:38

标签: ios react-native grid bar-chart react-native-svg-charts

我正在为项目设置react-native-svg-charts并遇到问题。在Android上,此代码创建一个垂直网格,但在iOS上未显示。即使我添加了一个由svg Lines组成的自定义网格组件,它在iOS上也无法使用。

我正在尝试使用其他iOS模拟器来确定错误,但没有人显示网格线

  const svgProps = {
    x: 100,
    y: 500,
    fill: 'tomato'
  }

      <BarChart
        style={{ flex: 1 }}
        data={values}
        animate>
        <Grid direction={Grid.Direction.VERTICAL} svg={svgProps} />
         <XAxis
          style={{ width: '95%', alignSelf: 'center', marginTop: chartHeight - 10 }}
          contentInset={{ left: 10, right: 10 }}
          data={data}
          formatLabel={i => months[i]}
        />
      </BarChart>

控制台无错误

0 个答案:

没有答案