0
<toolkit:Chart x:Name="pieChart" Grid.Row="2" Title="">
<toolkit:Chart.Series>
<toolkit:PieSeries ItemsSource="{Binding}"
IndependentValueBinding="{Binding A}"
DependentValueBinding="{Binding X}"
Margin="-500,0,0,0">
</toolkit:PieSeries>
<toolkit:PieSeries ItemsSource="{Binding}"
IndependentValueBinding="{Binding A}"
DependentValueBinding="{Binding Y}"
Margin="0,0,0,0"/>
<toolkit:PieSeries ItemsSource="{Binding}"
IndependentValueBinding="{Binding A}"
DependentValueBinding="{Binding Z}"
Margin="500,0,0,0"/>
</toolkit:Chart.Series>
</toolkit:Chart>
無邊距3個餡餅疊加到一個。我如何讓他們分成三個?注意:<toolkit:ColumnSeries
一切正常。
我想一個更好的問題將是:我如何顯示三個餡餅與一個傳說?
編輯:解決方案 像vorrtex建議,我發現沒有更簡單的方法來做到這一點。沒有傳說中的圖表:
<toolkit:Chart x:Name="pieChart" LegendStyle="{StaticResource NoLegendStyle}">
<toolkit:Chart.Series>
<toolkit:PieSeries ItemsSource="{Binding}"
IndependentValueBinding="{Binding A}"
DependentValueBinding="{Binding X}"/>
</toolkit:Chart.Series>
</toolkit:Chart>
傳奇無圖:
<toolkit:Chart x:Name="pieChart3" ChartAreaStyle="{StaticResource NoChartStyle}">
<toolkit:Chart.Series>
<toolkit:PieSeries ItemsSource="{Binding}"
IndependentValueBinding="{Binding A}"
DependentValueBinding="{Binding X}"/>
</toolkit:Chart.Series>
</toolkit:Chart>
哪裏風格:
<UserControl.Resources>
<Style x:Key ="NoLegendStyle" TargetType="toolkit:Legend">
<Setter Property="Height" Value="0" />
<Setter Property="Width" Value="0" />
</Style>
<Style x:Key ="NoChartStyle" TargetType="chartingPrimitivesToolkit:EdgePanel">
<Setter Property="Height" Value="0" />
<Setter Property="Width" Value="0" />
</Style>
</UserControl.Resources>
和
xmlns:chartingPrimitivesToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
所有圖表共享相同的datacontext 。
顯示3個沒有圖例的圖表,顯示1個圖例沒有圖表。這是最簡單的方法。 – vorrtex