RadChart Axis label styles

9 posts, 0 answers
  1. jason
    jason avatar
    28 posts
    Member since:
    Oct 2010

    Posted 03 Nov 2010 Link to this post

    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
  2. Sia
    Admin
    Sia avatar
    745 posts

    Posted 09 Nov 2010 Link to this post

    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
  3. Courouble Damien
    Courouble Damien avatar
    54 posts
    Member since:
    Aug 2009

    Posted 06 Jan 2011 Link to this post

    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
  4. Courouble Damien
    Courouble Damien avatar
    54 posts
    Member since:
    Aug 2009

    Posted 11 Jan 2011 Link to this post

    No one for this issue ? 
  5. Sia
    Admin
    Sia avatar
    745 posts

    Posted 11 Jan 2011 Link to this post

    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>>
  6. Courouble Damien
    Courouble Damien avatar
    54 posts
    Member since:
    Aug 2009

    Posted 13 Jan 2011 Link to this post

    Hey,

    Tested without success :(
    DO you have another solution ? 

    Thanks,

    Damien
  7. Sia
    Admin
    Sia avatar
    745 posts

    Posted 14 Jan 2011 Link to this post

    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>>
  8. jason
    jason avatar
    28 posts
    Member since:
    Oct 2010

    Posted 09 Mar 2011 Link to this post

    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.
  9. Sia
    Admin
    Sia avatar
    745 posts

    Posted 10 Mar 2011 Link to this post

    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!
Back to Top