发布于 2019-10-14 20:02:19
您应该尝试将颜色或样式置于状态,然后在onPress中对其进行更改。然后这些变化将会被反映出来:
onPress={()=> this.setState({colors: ['#7b4173', '#a55194', '#ce6dbd', '#de9ed6']})在StackedBarChart中,例如,插入为道具:
<StackedBarChart
style={{ height: 200 }}
keys={keys}
colors={this.state.colors}
data={data}
showGrid={false}
contentInset={{ top: 30, bottom: 30 }}
/>https://stackoverflow.com/questions/58375092
复制相似问题