Вопрос

Как мне увеличить эти прямоугольники? Я использую диаграммы Toolkit WPF, и я пытался играть с легендой управления, но она не помогла.

alt text

Это было полезно?

Решение

С смесью, на панели объектов:
Щелкните правой кнопкой мыши [PIEERIES
-Дит дополнительные шаблоны
-Дит легендин
-Детит копию

Вы должны получить стиль по умолчанию:

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

И ваш контроль получит Легендей стиль

<Charting:PieSeries ItemsSource="{Binding PutYourBindingHere}" 
                                    IndependentValueBinding="{Binding Key}" DependentValueBinding="{Binding Value}" IsSelectionEnabled="True" LegendItemStyle="{DynamicResource PieChartLegendItemStyle}">
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top