I’m using an Pie chart in Android. Currently when a user touches a slice, the slice animates out and rotates the center of the slice to 0.0. However, when I set the selected point of the series in code it will animate the slice out but not do the rotation of the chart. Is there something I need to do in code to trigger the rotation of the selected point?
At present we restrict the protrusion and rotation animations on the Pie and DonutSeries to selection by gesture. As such, selecting a slice in code shouldn’t cause it to animate in any way - it should just jump to the appropriate position. Calling series.setSelectedPosition(0.0f); will ensure the pie/donut series is rotated such that the slice’s centre is at 0.0 (i.e. the top).
From your post it sounds like the protrusion animation is happening even when you select a slice in code. Is this the case? If so, what version of ShinobiCharts for Android are you using?
Yes, when I set the selected point in code using series.setPointSelected(true, _selectedIndex) the protrusion animation runs but it will not roate to the selected position even with series.setSelectedPosition(0.0f) set. I’m using version 1.6.
Thanks for the extra info. That’s very strange - I’ve tried recreating this myself and the slice (as I would have expected) jumps out, and back in, without performing the protrusion animation.
Would it be at all possible to create a very simple sample app with this behaviour occurring and emailing it to firstname.lastname@example.org? I’ve used v1.6 when trying it myself so I’m not sure why there is a discrepency here!
When selecting the point in code the slice moves out but doesnt do the rotation to the selected point position. So what I’m gathering from your fist response is that selecting a point via gesutre and selecting it via code will have different results, one will rotate and the other will not?
Your assumption is correct - selecting a point via gesture will rotate it whilst selecting it via code will not. Crucially, at present when a point is selected via code the slice should just pop out, without animation. From your earlier post it sounds like you are seeing the slice animate out (upon programmatic selection) rather than just pop out. If this is the case we would be keen to look into this as this is not in line with the current design. If you are seeing animation in this way we’d be very grateful if you could send us some sample code, or ideally a simplified sample app to email@example.com. In this case we would investigate this matter further.