<View
style={styles.chart}}} >
<Svg height={400} width={400}>
<VictoryPie
colorScale={["#00897B", "#7fc4bd", "#b70104" ]}
innerRadius={90}
style={{
labels: {
fontSize: 18, fill: "#ffffff"
}
}}
animate={{ duration: 1500 }}
data={this.state.data}
padding={{ top: 0, bottom: 35, right:10, left:10 }}
labelRadius={100}
standalone={false}
width={400}
height={400}
events={[{
target: "data",
eventHandlers: {
onClick: () => {
return [
{
target: "data",
mutation: (props) => {
console.log('index: '+props.index);
return null;
}
}, {
target: "labels",
mutation: (props) => {
console.log('text: '+props.text);
return null;
}
}
];
}
}
}]}/>
<VictoryLabel
x={200} y={200}
textAnchor="middle"
style={{ fontSize: 23,fill: 'white'}}
text="Total Revenue"/>
</Svg>
</View>
我在 Victory Pie 中使用了standalone={false} 因为它在 svg 下,正如 github 中的许多胜利图表问题所建议的那样,但没有用它不会触发任何事件。它不适用于ios和android。请帮我