Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Chart > Custom legend item border

Answered Custom legend item border

Feed from this thread
  • Bhakti avatar

    Posted on Feb 3, 2012 (permalink)

     <SolidColorBrush x:Key="LegendBorderBrush"  Color="White" />
            <Thickness x:Key="LegendBorderThickness">0</Thickness>
            <Style x:Key="CustomLegendItemStyle" TargetType="telerik:ChartLegendItem">
                <Setter Property="BorderBrush"
                Value="{StaticResource LegendBorderBrush}" />
                <Setter Property="BorderThickness"
                Value="{StaticResource LegendBorderThickness}" />


                <Setter Property="Template" >
                    <Setter.Value>
                        <ControlTemplate TargetType="telerik:ChartLegendItem" >
                            <Border BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="{TemplateBinding Background}">
                                <Grid x:Name="PART_MainContainer" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0,0,5,0"  >


                                    <Path x:Name="PART_LegendItemMarker"                                 
                                      Height="20"
                                      Width="80"
                                      Style="{TemplateBinding ItemStyle}"
                                      Stretch="Fill"
                                      >
                                        <Path.Data>
                                            <PathGeometry x:Name="PART_ItemMarkerGeometry" />
                                        </Path.Data>
                                    </Path>


                                    <CheckBox IsChecked="True"
                                          VerticalAlignment="Center"
                                          Margin="2,0"
                                          Content="{TemplateBinding Label}"
                                          Foreground="{TemplateBinding Foreground}"                                      
                                          BorderThickness="0"
                                          Checked="CheckBox_Checked" Unchecked="CheckBox_Checked"   />


                                </Grid>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

    Above code used to set the radchart legend items. I do not need to display border color for legend items. Setting white,transparant or borderthickness 0 is not helping. Please throw some light. Thanks.

    Reply

  • Answer Sia Sia admin's avatar

    Posted on Feb 8, 2012 (permalink)

    Hello Bhakti,

    Please find our answer in the other forum thread concerning the same issue.
    We hope that the provided solution works as expected on your end.

    Greetings,
    Sia
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

  • Bhakti avatar

    Posted on Feb 8, 2012 (permalink)

    Worked as needed!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Chart > Custom legend item border
Related resources for "Custom legend item border"

WPF Chart Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]