WPF饼图不分片
我使用PieChart控件显示数据库中已使用和可用的两个值。但我得到的输出没有切片,如下图所示, 如何分割饼图 我的键值对是类型。我从数据源获取KeyValuePair的值&我使用linqtosql查询进行检索 我的饼图的XAML:WPF饼图不分片,wpf,xaml,charts,wpf-controls,Wpf,Xaml,Charts,Wpf Controls,我使用PieChart控件显示数据库中已使用和可用的两个值。但我得到的输出没有切片,如下图所示, 如何分割饼图 我的键值对是类型。我从数据源获取KeyValuePair的值&我使用linqtosql查询进行检索 我的饼图的XAML: <Window.Resources> <CollectionViewSource x:Key="ramView" Source="{Binding Path=UsageRAMs, Source={StaticResource serverV
<Window.Resources>
<CollectionViewSource x:Key="ramView" Source="{Binding Path=UsageRAMs, Source={StaticResource serverView}}"/>
</Window.Resources>
<dvc:Chart x:Name="Ram" Background="White" Foreground="Black" Margin="950,0,92,485" Grid.Column="1" Grid.Row="1">
<dvc:Chart.Series>
<dvc:PieSeries ItemsSource="{Binding}"
DependentValuePath="Available" IndependentValuePath="Used" >
</dvc:PieSeries>
</dvc:Chart.Series>
</dvc:Chart>
我想你应该有两个系列
<dvc:Chart ...>
<dvc:Chart.Series>
<dvc:PieSeries ItemsSource="{Binding}" DependentValuePath="Available" />
<dvc:PieSeries ItemsSource="{Binding}" DependentValuePath="Used" />
</dvc:Chart.Series>
</dvc:Chart>
免责声明-我没有测试它,但我会尝试这样做。谢谢您的回复。。但我的馅饼还是不切。。插图给我展示了两个传奇的标题。这给了每个系列另一种颜色。可能会有帮助。对不起,我不知道图表控件。我在猜。
<dvc:Chart ...>
<dvc:Chart.Series>
<dvc:PieSeries ItemsSource="{Binding}" DependentValuePath="Available" />
<dvc:PieSeries ItemsSource="{Binding}" DependentValuePath="Used" />
</dvc:Chart.Series>
</dvc:Chart>