Styling the IGPieChartView
Send Feedback

Glossary Item Box

Topic Overview


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

In this topic


Styling summary

The outlines and fill colors of the IGPieChartView control’s pie slices are completely customizable. Use the following two exposed properties to apply the customized styling.

  • brushes
  • outlines

These two properties are both of type NSMutableArray. They are required to contain only IGBrush objects to specify the colors to use. In addition to styling, you can also apply themes to the IGPieChartView. Please refer to the Themes topic for additional information.

Styling the IGPieChartView – Code Example


The code below demonstrates how to style the brush fill color and outline of the IGPieChartView. First, create an NSMutableArray to place the IGBrush objects into before assigning the respective mutable arrays to both the brushes and outlines property.


This code example requires the inclusion of the Chart 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();
NSMutableArray brushes = new NSMutableArray();
brushes.Add(new IGBrush(UIColor.Red));
brushes.Add(new IGBrush(UIColor.Green));
brushes.Add(new IGBrush(UIColor.Blue));
NSMutableArray outlines = new NSMutableArray();
outlines.Add(new IGBrush(UIColor.Magenta));
outlines.Add(new IGBrush(UIColor.Cyan));
outlines.Add(new IGBrush(UIColor.Brown));
_pieChartView.Brushes = brushes;
_pieChartView.Outlines = outlines;

In Objective-C:

NSMutableArray *brushes = [[NSMutableArray alloc]init];
[brushes addObject:[[IGBrush alloc]initWithColor:[UIColor redColor]]];
[brushes addObject:[[IGBrush alloc]initWithColor:[UIColor greenColor]]];
[brushes addObject:[[IGBrush alloc]initWithColor:[UIColor blueColor]]];    
NSMutableArray *outlines = [[NSMutableArray alloc]init];
[outlines addObject:[[IGBrush alloc]initWithColor:[UIColor magentaColor]]];
[outlines addObject:[[IGBrush alloc]initWithColor:[UIColor cyanColor]]];
[outlines addObject:[[IGBrush alloc]initWithColor:[UIColor brownColor]]];
_pieChartView.brushes = brushes;
_pieChartView.outlines = outlines;

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.