You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I am checking if there is a way we can bind the pie chart sections with the labels.. I was able to bind it in a way that if I click on section, the label is expanded, but i want to achieve the vice versa as well, like if i click on label, i am hoping to trigger focusOnPress for that index in pie chart..
I have added a new prop named focusedPieIndex available from version 1.4.16 onwards. 🎉
In your above example, you just need to pass the prop focusedPieIndex = {selected} and your requirement will be fulfilled.
Please use the latest version of the library.
So I am checking if there is a way we can bind the pie chart sections with the labels.. I was able to bind it in a way that if I click on section, the label is expanded, but i want to achieve the vice versa as well, like if i click on label, i am hoping to trigger focusOnPress for that index in pie chart..
Code currently i am using is below -
`const PieChartComponent: React.FC = ({
data,
donut = false,
radius = 100,
showText = true,
textSize = 14,
focusOnPress = true,
}) => {
const [selected, setSelected] = useState<number | null>(null);
};`
Any help will be appreciated.
The text was updated successfully, but these errors were encountered: