This is a migrated thread and some comments may be shown as answers.

Custom legend item border

2 Answers 29 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Bhakti
Top achievements
Rank 1
Bhakti asked on 03 Feb 2012, 05:29 PM
 <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.

2 Answers, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 08 Feb 2012, 10:56 AM
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 >>
0
Bhakti
Top achievements
Rank 1
answered on 08 Feb 2012, 04:30 PM
Worked as needed!
Tags
Chart
Asked by
Bhakti
Top achievements
Rank 1
Answers by
Sia
Telerik team
Bhakti
Top achievements
Rank 1
Share this question
or