change Chart Legend font color.

7 posts, 0 answers
  1. donghyun
    donghyun avatar
    5 posts
    Member since:
    Jun 2009

    Posted 20 Jul 2009 Link to this post

    when the theme of the chart is Vista or Summer, the font color of the lenged is not visible.
    the reaseon is font color is white so I try to change to color but it's not work well.

    how can i fix that?
  2. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 22 Jul 2009 Link to this post

    Hi donghyun,

    Unfortunately this is something that was overlooked in the implementation of the ChartLegend template in XAML. Other customers have reported this problem as well and we will fix it very soon (the fix will probably be out with one of the next internal builds and the service pack for sure). The work-around right now is to re-template the ChartLegend header template.

    Here is the header template xaml for the Office_Black theme:

    <Setter Property="HeaderTemplate" > 
        <Setter.Value> 
            <DataTemplate> 
                <Grid> 
                    <TextBlock FontSize="12"  
                   FontWeight="Bold"  
                   Foreground="{StaticResource LegendForeground}"  
                   Padding="0,0,0,2"   
                   HorizontalAlignment="Left"  
                   Width="Auto"  
                   Height="Auto"  
                   Text="{Binding}" /> 
                </Grid> 
            </DataTemplate> 
        </Setter.Value> 
    </Setter> 

    You can apply your custom legend style (overriding the header template) to RadChart.LegendStyle.
    Hope this helps.


    Sincerely yours,
    Vladimir Milev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 22 Mar 2010 Link to this post

    How can I change the color of the autogenerated label items text ?

  4. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 22 Mar 2010 Link to this post

    How can I change the color of the autogenerated label items text ?

  5. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 22 Mar 2010 Link to this post

    How can I change the color of the autogenerated label items text ?

  6. Benedict
    Benedict avatar
    16 posts
    Member since:
    Jun 2009

    Posted 22 Mar 2010 Link to this post

    Sorry for repost ... server problems here. Ofter timeouts

  7. Vladimir Milev
    Admin
    Vladimir Milev avatar
    1061 posts

    Posted 24 Mar 2010 Link to this post

    Hello Benedict,

    If RC1 is your RadChart instance you should simply use the LegendItemStyle property like this:

    RC1.DefaultView.ChartLegend.LegendItemStyle = new Style() { TargetType=typeof(ChartLegendItem) };
    RC1.DefaultView.ChartLegend.LegendItemStyle.Setters.Add(new Setter() { Property = Control.ForegroundProperty, Value = new SolidColorBrush(Colors.Red) });


    Your style can be also declared in XAML of course.

    Best wishes,
    Vladimir Milev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top