我正在尝试在一个图表中放置多个显示不同数据的折线图,但无法使用 react-native-svg-charts 在 react-native 中这样做。
<View style= {{height: 200}}>
<LineChart
style={{ flex:1 }}
data={this.state.data}
svg={{ stroke: 'rgb(134, 65, 244)' }}
contentInset={{ top: 20, bottom: 20 }}
>
<Grid/>
</LineChart>
<LineChart
style={{position: 'absolute'}}
data={this.state.data1}
svg={{ stroke: 'rgb(168, 155, 50)' }}
contentInset={{ top: 20, bottom: 20 }}
>
<Grid/>
</LineChart>
</View>
上面的代码是我正在尝试的,但由于我只得到第一个数据的折线图,所以无法获得正确的设计。
谢谢!