Exploding Slices on the IGPieChartView
Send Feedback

Glossary Item Box

Topic Overview

Purpose

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

In this topic


Introduction

Exploding slices summary

An exploded pie chart is any pie chart with one or more slices separated or extended out from the rest of the pie. Exploded slices can be visualized in one of two ways by setting the explodedDisplayStyle property found on the IGPieChartView. The subseqent enumerations are supported by the explodedDisplayStyle property.

  • IGPieSliceExplodedDisplayStyleExtendRadius - Exploded slice has a larger radius determined by the explodedRadius property
  • IGPieSliceExplodedDisplayStyleAwayFromCenter - Exploded slice is separated from the pie by the amount specified in the explodedRadius property from the center of origin

In the following graphic, the IGPieChartView has its explodedDisplayStyle set to IGPieSliceExplodedDisplayStyleAwayFromCenter, with slice 3 exploded.

To create additional exploded slices start by adding their index to an NSMutableIndexSet, and then assigning it to the explodedSlices property. Additionally, when using the pieChartView:tapWithItem:atPoint: method from the IGPieChartViewDelegate, the item parameter contains a reference to the IGPieSliceInfo object. This object has a configurable property named isExploded that explodes the tapped slice.


Exploding Slices on the IGPieChartView – Code Example

Description

The code below adds three indexes of IGPieChartView slices to an NSMutableIndexSet and sets the object to the explodedSlices property. The result is three exploded slices separated from the pie’s center and each other.

Prerequisites

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.

Code

In C#:

IGPieChartView _pieChartView = new IGPieChartView();
NSMutableIndexSet exploded = new NSMutableIndexSet();
exploded.Add(0);
exploded.Add(2);
exploded.Add(3);
_pieChartView.ExplodedSlices = exploded;

In Objective-C:

NSMutableIndexSet *exploded = [[NSMutableIndexSet alloc]init];[exploded addIndex:0];[exploded addIndex:2];[exploded addIndex:3];_pieChartView.explodedSlices = exploded;

Related Content

Topics

The following topics provide additional information related to this topic.

Topic

Purpose

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