wpf图表传奇

Ere*_*rez 4 wpf charts legend pie-chart

如何放大这些矩形?我正在使用wpf工具包图表,我试图使用控件图例,但它没有帮助.

替代文字

Ale*_*exT 7

使用Blend,在Objects面板中:
右键单击[PieSeries] -
编辑其他模板
-Edit LegendItemStyle
-Edit a Copy

你应该得到一个默认样式:

<Style x:Key="PieChartLegendItemStyle" TargetType="{x:Type chartingToolkit:LegendItem}">
    <Setter Property="IsTabStop" Value="False" />
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type chartingToolkit:LegendItem}">
                <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                    <StackPanel Orientation="Horizontal">
                        <Rectangle Width="8" Height="8" Fill="{Binding Background}" Stroke="{Binding BorderBrush}" StrokeThickness="1" Margin="0,0,3,0" />
                        <visualizationToolkit:Title Content="{TemplateBinding Content}" />
                    </StackPanel>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style> 
Run Code Online (Sandbox Code Playgroud)

你的控件将获得LegendItemStyle

<Charting:PieSeries ItemsSource="{Binding PutYourBindingHere}" 
                                    IndependentValueBinding="{Binding Key}" DependentValueBinding="{Binding Value}" IsSelectionEnabled="True" LegendItemStyle="{DynamicResource PieChartLegendItemStyle}">
Run Code Online (Sandbox Code Playgroud)