我正在尝试使用WCF Ria服务在我的应用程序中的饼图和区域系列图表上显示数据库中的数据。我按照此链接实现了相同的目标:http://code.msdn.microsoft.com/silverlight/Getting-Started-WCF-RIA-1469cbe2
当我在datagrid中显示数据时它工作正常但是在图表的情况下,相同的逻辑不起作用。这是我正在使用的xaml中的代码:
`<riaControls:DomainDataSource AutoLoad="True" Name="ErrorTrackingDataSource" QueryName="GetErrorTrackings" LoadSize="10">
<riaControls:DomainDataSource.DomainContext>
<ds:BSADomainContext></ds:BSADomainContext>
</riaControls:DomainDataSource.DomainContext>
<riaControls:DomainDataSource.SortDescriptors>
<riaControls:SortDescriptor PropertyPath="PID" Direction="Ascending"></riaControls:SortDescriptor>
</riaControls:DomainDataSource.SortDescriptors>
</riaControls:DomainDataSource>
<toolkit:Chart Title="Incident Count - Weekly" BorderThickness="2" Name="acChart" DataContext="{Binding ElementName=ErrorTrackingDataSource, Path=Data}">
<toolkit:Chart.Axes>
<toolkit:DateTimeAxis x:Name="XAxis2" DataContext="{Binding ElementName=TimeofCreation, Path=Data}">
</toolkit:DateTimeAxis>
<toolkit:LinearAxis x:Name="YAxis2" DataContext="{Binding ElementName=Incident, Path=Data}"></toolkit:LinearAxis>
</toolkit:Chart.Axes>
<toolkit:Chart.Series>
<toolkit:AreaSeries Name="errorTrackingAreaSeries" ItemsSource="{Binding ElementName=ErrorTrackingDataSource, Path=Data}" IndependentValueBinding="{Binding ElementName=XAxis1}" DependentValueBinding="{Binding ElementName=YAxis1}"
DataContext="{Binding ElementName=ErrorTrackingDataSource, Path=Data}">
</toolkit:AreaSeries>
</toolkit:Chart.Series>
</toolkit:Chart>
` 我不知道应采取什么方法?