Question

How do I enlarge those rectangles ? I'm using wpf toolkit charts and I've tried to play with the control legend but it didn't helped.

alt text

Was it helpful?

Solution

With Blend, in the Objects panel:
Right Click on [PieSeries]
-Edit Additional Templates
-Edit LegendItemStyle
-Edit a Copy

You should get a default style:

<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> 

And your control will get a LegendItemStyle

<Charting:PieSeries ItemsSource="{Binding PutYourBindingHere}" 
                                    IndependentValueBinding="{Binding Key}" DependentValueBinding="{Binding Value}" IsSelectionEnabled="True" LegendItemStyle="{DynamicResource PieChartLegendItemStyle}">
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top