Version

XamCategoryChart Property Inclusion and Exclusion

This topic explains, with code examples, how to configure which properties are displayed in the XamCategoryChart control.

Purpose

By default, the XamCategoryChart will plot all properties that exist on the underlying data items in the bound ItemsSource collection. This topic will inform you on how to pick which properties are plotted in the chart.

Required Background

The following topics are prerequisites to understanding this topic:

Topic Purpose

XamCategoryChart Overview

This topic provides conceptual information about the XamCategoryChart control including its main features, minimum requirements, and user functionality.

Binding to Data

This topic explains how to bind data to the XamCategoryChart control.

In this topic

This topic contains the following sections:

Property Settings

You can include and exclude properties from the XamCategoryChart by setting the following properties:

Property Name Property Type Description

IncludedProperties

string[]

Gets or sets a set of property paths that should be included for consideration by the chart, leaving the remainder excluded. If null, all properties will be considered.

ExcludedProperties

string[]

Gets or sets a set of property paths that should be excluded from consideration by the chart. The complex expressions can be used, for example to exclude a property in a sub-collection ,use wildcards such *.<propertyName> to exclude [0].<propertyName> , [1].<propertyName> and so on.

Code Snippet

The following code example uses the Energy Data Source sample code as its ItemsSource and shows how to achieve the following chart both by including and excluding properties.

In XAML

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

In XAML

<ig:XamCategoryChart x:Name="chart1" ItemsSource="{Binding}" IncludedProperties="Country,Hydro,Nuclear"/>

In XAML

<ig:XamCategoryChart x:Name="chart1" ItemsSource="{Binding}" ExcludedProperties="Coal,Oil,Gas"/>

In C#

string[] inclusion = { "Country", "Hydro", "Nuclear" };
chart1.IncludedProperties = inclusion;

In C#

string[] exclusion = { "Coal", "Oil", "Gas" };
chart1.ExcludedProperties = exclusion;

In Visual Basic

Dim inclusion As String() = {"Country", "Hydro", "Nuclear"}
chart1.IncludedProperties = inclusion

In Visual Basic

Dim inclusion As String() = {"Coal", "Oil", "Gas"}
chart1.ExcludedProperties = exclusion
categorychart included excluded.png

Related Content

Topic Purpose

Adding Category Chart

This article will get you up and running with the XamCategoryChart control.