แผนภูมิวงกลมที่ใช้คำแนะนำเครื่องมือและ activeIndex ทำงานไม่ถูกต้อง คำแนะนำเครื่องมือจะไม่แสดงขึ้นเว้นแต่คุณจะกลับเข้าสู่เซกเตอร์เดิมอีกครั้ง เมื่อคุณไม่ได้อยู่ในเซกเตอร์เดียวกัน มันจะแสดงคำเตือน: ประเภทเสาที่ล้มเหลว: เสาไม่ถูกต้อง activeIndex
ที่ให้มากับ Pie
<PieChart
className="pie-chart"
width={this.props.width ? this.props.width : 500}
height={375}
onMouseEnter={this.onPieEnter}
>
<Pie
dataKey="value"
data={data}
// cx={250}
// cy={100}
activeIndex={
this.state.activeIndex === undefined
? 0
: this.state.activeIndex
}
activeShape={this.renderActiveShape}
outerRadius={
this.state.width <= 1025 && this.state.width > 768 ? 80 : 100
}
innerRadius={
this.state.width <= 1025 && this.state.width > 768 ? 65 : 85
}
fill="#8884d8"
onMouseEnter={this.onPieEnter}
>
{data.map((entry, index) => (
<Cell
key={index}
fill={this.COLORS[index % this.COLORS.length]}
/>
))}
</Pie>
</PieChart>
ดัชนีที่ใช้งานเริ่มต้นจะถูกตั้งค่าเสมอ ดังนั้นเมื่อคุณไม่ได้อยู่ในคำแนะนำเครื่องมือวงกลมเซกเตอร์เดียวกันจะแสดง