Version

Binding to Data

The XamFinancialChart uses a data adapter to analyze the data sources and apply rules to them to plot the data, whether you use a single data set or multiple.

In some cases you may need to explicitly define whether or not a particular property associated with your data model needs to plot. You can either set the property in the IncludedProperties or ExcludedProperties to tell the chart if they should be included or excluded:

In XAML:

<ig:XamFinancialChart ItemsSource="{Binding ChartData}"
                      IncludedProperties="{Binding IncludedDataFields}"
                      ExcludedProperties="{Binding ExcludedDataFields}" />

In C#:

var chart = new XamFinancialChart();
chart.IncludedProperties = new string[] { "Open", "High", "Low", "Close", "Volume", "Date" };
chart.ExcludedProperties = new string[] { "PercentChange", "SellOrders", "BuyOrders", "Label" };

In Visual Basic:

Dim chart = New XamFinancialChart()
chart.IncludedProperties = New String(){ "Open", "High", "Low", "Close", "Volume", "Date" }
chart.ExcludedProperties = New String(){ "PercentChange", "SellOrders", "BuyOrders", "Label" }

The following topics go further in describing how to bind to data: