Radial Line Series
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic provides a conceptual overview of the Radial Line series in the IGChartView™ control and uses a code sample to demonstrate how to add it to the chart view.

In this topic


Introduction

Radial Line series summary

The Radial line series uses a collection of straight lines connecting data points when rendered. The radial line series uses the same concepts of data plotting as the line series, but wraps data points around a circle rather than stretching them along a horizontal line.

Data requirements

While the IGChartView control allows for easy binding to your own data model, it is important that you supply the appropriate amount and type of data required by that series. If the data model does not meet the series’ minimum requirements, the IGChartView will appear blank.

Required – the bound data model must contain one numeric field to render Radial Line series data.


Adding a Radial Line Series to the IGChartView – Code Example

Description

The code below uses the IGCategorySeriesDataSourceHelper to supply randomly generated data to a radial line series that first gets added to the IGChartView instance, and then the IGChartView is added as a subview of the current UIView.

Prerequisites

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

Code

In Objective-C:

    NSMutableArray *values = [[NSMutableArray alloc] init];
    for (int i = 0; i < 25; i++) {
        [values addObject:[[NSNumber alloc] initWithDouble:(arc4random() % 100)]];
    }
    
    IGCategorySeriesDataSourceHelper *source = [[IGCategorySeriesDataSourceHelper alloc] init];
    source.values = values;
    
    IGChartView *infraChart = [[IGChartView alloc] initWithFrame:self.view.frame];
    
    IGCategoryAngleAxis *angleAxis = [[IGCategoryAngleAxis alloc] initWithKey:@"angleAxis"];
    IGNumericRadiusAxis *radiusAxis = [[IGNumericRadiusAxis alloc] initWithKey:@"radiusAxis"];
    radiusAxis.innerRadiusExtentScale = 0.10;
    [infraChart addAxis:angleAxis];
    [infraChart addAxis:radiusAxis];
    
    IGRadialLineSeries *radialLineSeries = [[IGRadialLineSeries alloc] initWithKey:@"radialLineSeries"];
    radialLineSeries.angleAxis = angleAxis;
    radialLineSeries.valueAxis = radiusAxis;
    radialLineSeries.dataSource = source;
    radialLineSeries.markerType = IGMarkerTypeNone;
    
    [infraChart addSeries:radialLineSeries];
    [self.view addSubview:infraChart];

In C#:



List<NSObject> data = new List<NSObject>();
Random r = new Random();
for(int i = 0;i <25; i++)
{
double val = r.Next() % 100;
data.Add(new NSNumber(val));
}

IGCategoryDateSeriesDataSourceHelper source = new IGCategoryDateSeriesDataSourceHelper();
source.Values = data.ToArray();



IGChartView chart = new IGChartView(this.View.Frame);
chart.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;

this.View.AddSubview(chart);


IGCategoryAngleAxis angleAxis = new IGCategoryAngleAxis("angleAxis");
IGNumericRadiusAxis radiusAxis = new IGNumericRadiusAxis("radiusAxis");
chart.AddAxis(angleAxis );
chart.AddAxis(radiusAxis );

radiusAxis.InnerRadiusExtentScale = 0.10f;


IGRadialLineSeries series= new IGRadialLineSeries("series");
series.AngleAxis= angleAxis ;
series.RadiusAxis = radiusAxis ;
series.DataSource = source;

chart.AddSeries(columnSeries);


Related Content

Topics

The following topics provide additional information related to this topic.

Topic

Purpose

This is a group of topics explaining the various types of Radial series supported by the IGChartView control.