Legend
Send Feedback

Glossary Item Box

Topic Overview

Purpose

This topic provides an introductory overview about legends in the IGFunnelChartView™ control.

In this topic


Introduction

Legend summary

The legend is a view displaying a series of legend items that identify the name of elements represented in the funnel chart. Denoted by a colored icon and a label each legend item represents a slice on the IGFunnelChartView. The icon uses the slice brush with the label being the inner label string. The legend can be positioned anywhere in the application’s view and does not have to be part of the IGFunnelChartView, but can link to funnel charts via the legend property on the IGFunnelChartView.

Legend preview

The image below presents an IGFunnelChartView rendered onto a view containing a legend above the chart. Each item’s icon in the legend corresponds to the slice of the same color.


Adding a Legend to a View – Code Example

Description

The following code creates an IGLegend instance and assigns it to the legend property on the IGFunnelChartView before adding the legend to the subview. Setting the legend property on the chart renders a legend containing items for every series added to the IGFunnelChartView.

Prerequisites

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.

Code

In C#:

IGLegend legend = new IGLegend(IGChartLegendType.IGChartLegendTypeItem);
legend.Frame = new RectangleF(0.0f, 0.0f, this.View.Frame.Size.Width, 45.0f);
legend.AutoresizingMask = UIViewAutoresizing.FlexibleWidth|UIViewAutoresizing.FlexibleBottomMargin;
legend.HorizontalAlignment = IGHorizontalAlign.IGHorizontalAlignStretch;
legend.VerticalAlignment = IGVerticalAlign.IGVerticalAlignCenter;
legend.Orientation = IGOrientation.IGOrientationHorizontal;
yourFunnelChart.Legend = legend;
this.View.Add (legend);

In Objective-C:

IGLegend *legend = [[IGLegend alloc] initWithLegendType:IGChartLegendTypeItem];
legend.frame = CGRectMake(0, 0, self.view.frame.size.width, 45);
legend.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleBottomMargin;
legend.horizontalAlignment = IGHorizontalAlignStretch;
legend.verticalAlignment = IGVerticalAlignCenter;
legend.orientation = IGOrientationHorizontal;
yourFunnelChart.legend = legend;
[self.view addSubview:legend];

Related Content

Topics

The following topic provides additional information related to this topic.

Topic

Purpose

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