我想将数据显示为折线图而不是文本。
我使用了react-native-charts-wrapper来绘制图形,请帮帮我
.then(res => res.json())
.then(res => {
console.log(`res: ${JSON.stringify(res['activities-distance'])}`);
this.setState({
result:res['activities-distance']});
})
}
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>All-Day Activity</Text>
<Button title="CHECK STEPS" onPress{()=>this.connectFitbit()}/>
<FlatList
data={this.state.result}
renderItem={
({item}) => <View>
<Text>DATE : {item.dateTime}</Text>
<Text>STEPS :{item.value}</Text>
</View>
}
keyExtractor={(item, index) => {return index+item}}/>
</View>