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

RadChart Axis label styles

8 Answers 125 Views
Chart
This is a migrated thread and some comments may be shown as answers.
jason
Top achievements
Rank 1
jason asked on 03 Nov 2010, 07:53 PM
I am stuck on what seems like very stupid thing for me to not be able to figure out.  How do I change the style of an axis label?  Currently it is showing up as a big gray box with bold black text.  I have tried following the help section and applying a style like this:

<Style x:Key="xStyle" TargetType="TextBlock">
          <Setter Property="Foreground" Value="Maroon" />
          <Setter Property="FontSize" Value="12"/>
          <Setter Property="FontFamily" Value="Verdana" />
      </Style>

And setting it in the code behind:
this.theChart.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle = this.Resources["xStyle"] as Style;

I have also tried setting this:  AxisForeground="Red"

None of this working and I am at my wits end with this.  I have tried looking at all of the demo code but nowhere in the demos do I see any style being set for these labels but they don't look anything like what I am getting.

thanks in advance

8 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 09 Nov 2010, 10:22 AM
Hi Jason,

Do you mean the axis title or the axis labels? And can you please tell us which theme you use, because the default look of the axis labels is without background. I have tested your style and it works as expected on my end. Any kind of additional information will be appreciated. Thank you very much in advance.

Best wishes,
Sia
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
0
Courouble Damien
Top achievements
Rank 1
answered on 06 Jan 2011, 05:34 PM
Hi guys

I'm facing the same issue with applying a custom style on ItemLabel 
I've follow this http://www.telerik.com/help/silverlight/radchart-styling-and-appearance-styling-axis-item-label.html
but without sucess

I'm generate and apply style via code behind but nothing happen

Dim tAxisXLabelStyle As New Style(GetType(TextBlock))
     tAxisXLabelStyle.Setters.Add(New Setter(FontSizeProperty, pAxisYLabel.FontHeightLabel))
     tAxisXLabelStyle.Setters.Add(New Setter(ForegroundProperty, pAxisYLabel.FontColorLabel))
     tAxisXLabelStyle.Setters.Add(New Setter(FontFamilyProperty, pAxisYLabel.FontFamilyLabel))
           _Chart.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle = tAxisXLabelStyle

I'm using the summer theme via 

StyleManager.ApplicationTheme = New SummerTheme

Could anyone help me ? 

Thanks, 

Damien
0
Courouble Damien
Top achievements
Rank 1
answered on 11 Jan 2011, 05:14 PM
No one for this issue ? 
0
Sia
Telerik team
answered on 11 Jan 2011, 05:42 PM
Hello Courouble Damien,

Please try with the following code:
Dim tAxisXLabelStyleAs New Style(GetType(TextBlock))
tAxisXLabelStyle.Setters.Add(New Setter(TextBlock.ForegroundProperty, "Red"))
tAxisXLabelStyle.Setters.Add(New Setter(TextBlock.FontStyleProperty, FontStyles.Italic))
_Chart.DefaultView.ChartArea.AxisX.AxisStyles.ItemLabelStyle = tAxisXLabelStyle

Best wishes,
Sia
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Courouble Damien
Top achievements
Rank 1
answered on 13 Jan 2011, 12:08 PM
Hey,

Tested without success :(
DO you have another solution ? 

Thanks,

Damien
0
Sia
Telerik team
answered on 14 Jan 2011, 01:40 PM
Hello Courouble Damien,

Please send us a sample project which we will be able to modify and check what causes your problem.
Also you can try to update your telerik binaries with a newer version and let us know if you still experience this problem.

Regards,
Sia
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
jason
Top achievements
Rank 1
answered on 09 Mar 2011, 07:41 PM
Sorry for the late response.  I was referring to the axis labels.  I am not applying any theme to the chart.  I have attached a screen shot of my results using the latest binaries.  What I would like is for it to not look like a button.
0
Sia
Telerik team
answered on 10 Mar 2011, 06:18 PM
Hi Jason,

Please put the following Style in your UserControl.Resources:
<Style TargetType="telerikCharting:Label3D">
      <Setter Property="Background" Value="Transparent" />
      <Setter Property="BorderBrush" Value="Transparent" />
      <Setter Property="BorderThickness" Value="1" />
      <Setter Property="Foreground" Value="Black" />
      <Setter Property="Padding" Value="4,0,4,0" />
</Style>

where:
xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"

and modify it to correspond with your needs. It will be applied to all labels in your 3D RadChart. I hope this helps.

All the best,
Sia
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Chart
Asked by
jason
Top achievements
Rank 1
Answers by
Sia
Telerik team
Courouble Damien
Top achievements
Rank 1
jason
Top achievements
Rank 1
Share this question
or