Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Chart > Unable to remove borders from chart legend

Not answered Unable to remove borders from chart legend

Feed from this thread
  • Venkatesh avatar

    Posted on Feb 1, 2012 (permalink)

    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"
        TargetType="telerik:ChartLegend">
            <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" >
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:ChartLegend">
                        <Border
                            Background="{x:Null}"
                            BorderBrush="{x:Null}"
                            BorderThickness="0" >
                            <Grid Margin="{TemplateBinding Padding}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                <ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" >
                                    <ItemsPresenter/>
                                </ScrollViewer>
                            </Grid>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="ItemsPanel">
                <Setter.Value>
                    <ItemsPanelTemplate>
                        <telerik:RadWrapPanel/>
                    </ItemsPanelTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    Reply

  • Evgenia Evgenia admin's avatar

    Posted on Feb 6, 2012 (permalink)

    Hello Venkatesh,

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

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

    Kind regards,
    Evgenia
    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

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Chart > Unable to remove borders from chart legend
Related resources for "Unable to remove borders from chart legend"

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