Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Only explode one pie slice at a time
posted

Hello, I am trying to implement the exploding pie slice functionality in my pie chart.  I have followed the online example to make the slices explode/un-explode when pressed.  However, I would like only one exploded slice to be showing at a time. For when the user selects the slice I have tried to implement the following code:

-(void)pieChartView:(IGPieChartView*)pieChartView tapWithItem:(IGPieSliceInfo*)item atPoint:(CGPoint)point{

    if(lastSelectedSlice){

        lastSelectedSlice.isExploded = NO;

    }

    item.isExploded = !item.isExploded;

    lastSelectedSlice = item;

}

I have stepped though this method, and my lastSelectedSlice object seems to be setting correctly the exploded property correctly, however the pie chart only seems to update the state of the selected pie slice.  How would I update the other pie slices to show if they are exploded or not?