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

change Chart Legend font color.

6 Answers 173 Views
Chart
This is a migrated thread and some comments may be shown as answers.
donghyun
Top achievements
Rank 1
donghyun asked on 20 Jul 2009, 11:34 AM
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?

6 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 22 Jul 2009, 06:24 AM
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.
0
Benedict
Top achievements
Rank 1
answered on 22 Mar 2010, 09:32 AM
How can I change the color of the autogenerated label items text ?

0
Benedict
Top achievements
Rank 1
answered on 22 Mar 2010, 09:36 AM
How can I change the color of the autogenerated label items text ?

0
Benedict
Top achievements
Rank 1
answered on 22 Mar 2010, 09:38 AM
How can I change the color of the autogenerated label items text ?

0
Benedict
Top achievements
Rank 1
answered on 22 Mar 2010, 10:37 AM
Sorry for repost ... server problems here. Ofter timeouts

0
Vladimir Milev
Telerik team
answered on 24 Mar 2010, 08:29 AM
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.
Tags
Chart
Asked by
donghyun
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Benedict
Top achievements
Rank 1
Share this question
or