Version

Getting Started with XamShapeChart

Topic Overview

Purpose

This topic explains with a code example how to add the XamShapeChart control to WPF applications.

Introduction

The following procedure shows how to add the XamShapeChart to WPF applications.

Preview

The following is a screenshot of the XamShapeChart.

shapechart getting started.png

Requirements

Add the following NuGet package to your application:

  • Infragistics.WPF.Charts

For more information on setting up the NuGet feed and adding NuGet packages, you can take a look at the following documentation: NuGet Feeds.

In XAML:

xmlns:ig="http://schemas.infragistics.com/xaml"

In C#:

using Infragistics.Controls.Charts;

In VB:

Imports Infragistics.Controls.Charts

Adding the XamShapeChart to the WPF application

1. Add the XamShapeChart to the page.

The following code demonstrates adding the XamShapeChart control with the minimal code and property settings required for display. The below code uses the Sample Scatter Data resource.

In XAML:

<Grid x:Name="layoutRoot">
    <ig:XamShapeChart ItemsSource="{Binding DataCollection}" />
</Grid>

In C#:

var data = new ScatterDataSource();
var shapeChart = new XamShapeChart();
shapeChart.ItemsSource = data;
this.layoutRoot.Children.Add(shapeChart);

In VB:

Dim data As New ScatterDataSource()
Dim shapeChart As New XamShapeChart()
shapeChart.ItemsSource = data
Me.layoutRoot.Children.Add(shapeChart)

2. Verify the results.

Build and run your project to verify the result. If you have implemented the steps correctly, the displayed XamShapeChart should look like the one in the Preview section above.

Topics

The following topics provide additional information related to this topic: