tags:

views:

37

answers:

1

Hello,

I am new to using RIA Services in Silverlight. I have created a DomainDataSource. This DomainDataSource is called myDataSource. I have successfully bound the DomainDataSource to a DataGrid. I am now trying to bind the same DomainDataSource to a Chart. However, when I bind the DomainDataSource to the Chart, nothing appears. No error is thrown either.

Does anybody have an example of a Chart that binds to a DomainDataSource?

I could not find an example on the internet.

Thank you!

+1  A: 

You can't bind directly to the chart. You need to create a series and bind your data to that. This creates a line:

<chartingToolkit:Chart>
    <chartingToolkit:LineSeries ItemsSource="{Binding ChartDataPoints, Mode=OneWay}" 
                                IndependentValuePath="X_ValuePath" 
                                DependentValuePath="Y_ValuePath" /> 
</chartingToolkit:Chart>
Stephan