Unable to remove borders from chart legend

2 posts, 0 answers
  1. Venkatesh
    Venkatesh avatar
    8 posts
    Member since:
    Dec 2011

    Posted 01 Feb 2012 Link to this post

    I am using the following code for custom chart legend. I am unable to remove the border of the legend. Can you please tell me how to do.
        <Style x:Key="ChartLegendStyle"
            <Setter Property="Foreground" Value="{StaticResource LegendForeground}" />
            <Setter Property="Background" Value="{x:Null}" />
            <Setter Property="Padding" Value="10,10,10,5" />
            <Setter Property="Margin" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
            <Setter Property="LegendItemMarkerShape" Value="{StaticResource LegendItemMarkerShape}" />
            <Setter Property="Template" >
                    <ControlTemplate TargetType="telerik:ChartLegend">
                            BorderThickness="0" >
                            <Grid Margin="{TemplateBinding Padding}">
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" >
            <Setter Property="ItemsPanel">
  2. Evgenia
    Evgenia avatar
    1396 posts

    Posted 06 Feb 2012 Link to this post

    Hello Venkatesh,

    The following modification in the Legend Style works as expected on our side. Could you give it a try? :
          <Style x:Key="CustomLegendStyle" TargetType="telerik:ChartLegend">
              <Setter Property="BorderBrush" Value="Transparent"/>

    RadChart1.DefaultView.ChartLegend.Style = this.Resources["CustomLegendStyle"] as Style;

    Kind regards,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft R3 2016 release webinar banner
Back to Top