MPAndroidChart
MPAndroidChart copied to clipboard
PieChart - add slice space on highlight when touching.
Hi everyone! I am working with PieChart. I want to make the highlight has slice space when touching on pie. like the example image on home page
The SliceSpace of PieChart = 0, But I couldn't found how to add slice space when touching like this image. I also check the drawHighlighted(), but it look very complex for me.
Thanks for help.
@congdanh1608 Hi, did you manage to achieve this?
to anyone who needs it in future, I managed to get this result by using a customPieChartRenderer that extends PieChartRenderer.
I copied the original onHighlight func in PieChartRenderer and overrode it on customPieChartRenderer and pasted the original function with one minor change
I changed the line : val sliceSpace = if (visibleAngleCount <= 1) 0f else set.sliceSpace to: val sliceSpace = if (visibleAngleCount <= 1) 0f else {desired slice spacing in float}