Polar Spline Series
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic provides a conceptual overview of the Polar Spline Series in the IGChartView™ control and provides a code example showing you how to add it to the chart views.

In this topic


Introduction

Polar Spline series summary

Rendered using a collection of spline lines connecting data points in polar (angle/radius) coordinate system, the Polar Spline series uses the same concepts of data plotting as the Scatter Spline Series but wraps data points around a circle rather than stretching them along a horizontal line., You can plot multiple Polar Spline series, like with other series types, in the same data chart and they may be overlaid one apon another to show the differences and similarities between data sets.

Data requirements

While the IGChartView control allows for easy binding to your own data model, make sure to supply the appropriate data amounts and types required by the series. Failing to do so causes the IGChartView to appear blank.

Required –The bound data model must contain 2 numeric fields, one for each of the two polar coordinates (angle and radius), for rendering polar line data.


Adding a Polar Spline Series to the IGChartView – Code Example

Description

The code below uses the IGPolarSeriesDataSourceHelper to supply randomly generated data to a Polar Spline Series by first adding to the IGChartView instance, and then adding the IGChartView 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 is available in the Adding the Chart Framework File topic.

Code

In C#:

NSMutableArray angle = new NSMutableArray();
for (int i = 0; i < 25; i++) {
      angle.Add(new NSNumber((i * 14)));
}
NSMutableArray radius = new NSMutableArray();
for (int i = 0; i < 25; i++) {
      radius.Add(new NSNumber((new Random(i).Next() % 100)));
}
IGPolarSeriesDataSourceHelper source = new IGPolarSeriesDataSourceHelper();
source.AngleValues = angle;
source.RadiusValues = radius;
IGChartView infraChart = new IGChartView(this.View.Frame);
IGNumericAngleAxis angleAxis = new IGNumericAngleAxis("angleAxis");
IGNumericRadiusAxis radiusAxis = new IGNumericRadiusAxis("radiusAxis");
angleAxis.Minimum = 0;
angleAxis.Maximum = 360;
angleAxis.Interval = 30;
infraChart.AddAxis(angleAxis);
infraChart.AddAxis(radiusAxis);
IGPolarSplineSeries polarSplineSeries = new IGPolarSplineSeries("polarSplineSeries");
polarSplineSeries.AngleAxis = angleAxis;
polarSplineSeries.RadiusAxis = radiusAxis;
polarSplineSeries.DataSource = source;
polarSplineSeries.MarkerType = IGMarkerType.IGMarkerTypeNone;
infraChart.AddSeries(polarSplineSeries);
(this.View).AddSubview(infraChart);

In Objective-C:

    NSMutableArray *angle = [[NSMutableArray alloc] init];
    for (int i = 0; i < 25; i++) {
        [angle addObject:[[NSNumber alloc] initWithDouble:(i * 14)]];
    }
    
    NSMutableArray *radius = [[NSMutableArray alloc] init];
    for (int i = 0; i < 25; i++) {
        [radius addObject:[[NSNumber alloc] initWithDouble:(arc4random() % 100)]];
    }
    
    IGPolarSeriesDataSourceHelper *source = [[IGPolarSeriesDataSourceHelper alloc] init];
    source.angleValues = angle;
    source.radiusValues = radius;
    
    IGChartView *infraChart = [[IGChartView alloc] initWithFrame:self.view.frame];
    
    IGNumericAngleAxis *angleAxis = [[IGNumericAngleAxis alloc] initWithKey:@"angleAxis"];
    IGNumericRadiusAxis *radiusAxis = [[IGNumericRadiusAxis alloc] initWithKey:@"radiusAxis"];
    angleAxis.minimum = 0;
    angleAxis.maximum = 360;
    angleAxis.interval = 30;
    [infraChart addAxis:angleAxis];
    [infraChart addAxis:radiusAxis];
    
    IGPolarSplineSeries *polarSplineSeries = [[IGPolarSplineSeries alloc] initWithKey:@"polarSplineSeries"];
    polarSplineSeries.angleAxis = angleAxis;
    polarSplineSeries.radiusAxis = radiusAxis;
    polarSplineSeries.dataSource = source;
    polarSplineSeries.markerType = IGMarkerTypeNone;
    
    [infraChart addSeries:polarSplineSeries];
    [self.view addSubview:infraChart];

Related Content

Topics

The following topics provide additional information related to this topic.

Topic

Purpose

This collection of topics explains each of the individual charts supported by the IGChartView control.