Skip to content

Latest commit

 

History

History
495 lines (330 loc) · 9.09 KB

datachart-creating-chart-in-code-behind-xaml.adoc

File metadata and controls

495 lines (330 loc) · 9.09 KB

Creating Chart in Code Behind

Topic Overview

Purpose

This topic provides detailed instruction on how to create the {DataChartName} control in code-behind.

Required Background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic provides a general overview of the {DataChartName} control

This topic provides information on how to get started with the {DataChartName} control.

This topic provides information on requirements of Series objects in the {DataChartName} control.

Overview

Preview

The following is the preview of the result of creating chart control in code-behind.

DataChart Creating Chart In Code Behind 1

Application Requirements

The following table lists requirements for creating the {DataChartName} control.

Requirement Description

Install the Infragistics product

The chart control is part of the Infragistics product

Chart Requirements

The chart control supports various types of data visualizations called Series. These series objects can visualize wide range of data source. Refer to the Series Types topic for complete list of series supported in the chart control. Each type of series can plot data that meets certain requirements (such as number of data column and their types) as well as what type of axis can be used with it. Refer to the Series Requirements topic for requirements for each of the series.

For demonstration purpose, this topic uses Sample Energy Data with only one AreaSeries and two axes: CategoryXAxis and NumericYAxis.

Creating Application

  1. Create {PlatformName} application project using {PlatformIDE} or latest and call it SampleApp

  1. Import the following namespaces to the main code file:

Adding Assembly References

  1. Add the following Infragistics assemblies to the SampleApp project:

Creating Data Source

  1. Copy sample data code from the Sample Energy Data resource and add it to the SampleApp project

  1. Create an instance of category sample data:

Creating Axes

Create category x-axis for displaying labels on horizontal axis

Create numeric y-axis for displaying values on vertical axis

Creating Series

Create an instance of a series and with bounding to the sample data source and set data mapping. In addition, the series must have settings for two axes created in previous section.

Creating Chart

Create an instance of the chart control with settings for one series and two axes.

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides a general overview of the {DataChartName} control

This topic provides information on how to get started with the {DataChartName} control.

This topic provides information on requirements of Series objects in the {DataChartName} control.