Selecting Slices on the IGPieChartView
Send Feedback

Glossary Item Box

Topic Overview


This topic provides a conceptual overview of selecting slices on the IGPieChartView™ control and demonstrates its configuration using a code example.

In this topic


Selecting slices summary

A selected pie slice uses an outline, brush color or both to signify its selection. Selected slices use the selectedBrush and selectedOutline properties for applying distinct colors to the selected slices.

One method for creating Selected slices is by adding their index to an NSMutableIndexSet, and then assigning the NSMutableIndexSet instance to the selectedSlices property. Additionally, when using the IGPieChartViewDelegate control’s pieChartView:tapWithItem:atPoint: method, the item parameter contains a reference to the IGPieSliceInfo object, which has a settable property named isSelected that selects or deselects the tapped slice.

Selecting Slices on the IGPieChartView – Code Example


The code below adds two indexes of the IGPieChartView slices to an NSMutableIndexSet and sets this object to the selectedSlices property. The result is a pie chart with two selected slices.


This code example requires the inclusion of the IG framework, detail about how to add this framework can be found in the Adding the Chart Framework File topic.


In C#:

IGPieChartView _pieChartView = new IGPieChartView();
NSMutableIndexSet selected = new NSMutableIndexSet();
_pieChartView.SelectedSlices = selected;

In Objective-C:

NSMutableIndexSet *selected = [[NSMutableIndexSet alloc]init];
[selected addIndex:1];
[selected addIndex:4];
_pieChartView.selectedSlices = selected;

Related Content


The following topic provides additional information related to this topic.



The topics in this group cover enabling, configuring, and using the IGPieChartView control’s supported features.