npm install react-chart-tooltipjavascript
import ToolTip from 'react-chart-tooltip';
`
$3
`javascript
{
tooltip: { // default
show: true,
formatter: (ringInfo) => {
return 占比: ${ringInfo.percent*100}%;
}
},
tooltipStyle: {
backgroundColor: 'rgba(0,0,0,0.65)',
...
},
x, // postiton.x
y, // postiton.y
info,
title,
width, // container width
height, // container height
}
``