Send Feedback

Glossary Item Box

Topic Overview


This topic provides a conceptual overview of the IGBrush support in the IGChartView™ control and uses code examples to explain how to set properties requiring this object type.

In this topic


Brushes summary

The charting framework makes extensive uses of properties that require the IGBrush object type. Brushes add solid colors to chart elements. IGBrush type properties, set directly on the series, take precedence over any other brushes set on the IGChartView. Chart axis lines and major gridlines have a default gray colored brush. Minor chart gridlines will only show up if a brush is set for the minorStroke property.

Creating a Solid Color Brush – Code Example


Solid brushes are based on RGBA values and are created using red, green, blue and alpha components. The value of each component must be a float values between 0.0 and 1.0. The brush can also be created from a UIColor, which can be useful when colors are already defined in the application.

The following code demonstrates the creation of both an IGBrush using RGBA and another IGBrush using UIColor.


In Objective-C:

//Light red colored brush using RGBA
IGBrush *brush = [[IGBrush alloc]initWithR:1.0 andG:0.5 andB:0.5 andA:1.0];
//Orange colored brush using the UIColor orangeColor preset
IGBrush *brush = [[IGBrush alloc]initWithColor:[UIColor orangeColor]];

In C#:

//Light red colored brush using RGBA
IGBrush brush = new IGBrush(1.0f, .5f, .5f, 1.0f);[
//Orange colored brush using the UIColor orangeColor preset
IGBrush *brush = new IGBrush(UIColor.Orange);

Related Content


The following topic provides additional information related to this topic.



This topic serves as a gateway to the features and functionality of the IGChartView control.