Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Binding DataPoint / Marker properties to DataPoint data source values
posted

We have a chart that displays a list of business objects (say Customers) as a single series in a 2D Line Chart.

A data point is created per customer, and the value is mapped to a data item value, eg.

series.DataSource = customers;

series.DataMapping = "Value=TotalSales;Label=CustomerName";

I would like to be able to affect parameters of the marker using a data binding, preferably declaratively using a XAML <Style> or <Marker>. However I do not seem to be able to access the Customer object in the <Marker> data context. For example:

<Style TargetType="{x:Type igCA:Marker}" >

<Style.Triggers>

<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self},Path=Value.CustomerType}" Value="Gold">

<Setter Property="Type" Value="Star5" />

</DataTrigger>

</Style.Triggers>

</Style>

However this does not work as neither the Marker nor the DataPoint seem to have a property the exposes the real data bound object (the Customer object in this case). Only the data mapped values are available...

Can anyone tell me how to data bind marker properties to my data bound object's properties?

Any help appreciated.

Keith