Format X-axis Label

Thread is closed for posting
3 posts, 0 answers
  1. Dave
    Dave avatar
    13 posts
    Member since:
    May 2012

    Posted 21 Feb 2013 Link to this post

    Hi,

    I am tying to set the font size of the x-axis label in a RadHTMLChart (q3 2012). The <TextStyle> property is not available and the only options that I see in <LabelsAppearance /> are DataFormatString, RotationAngle, and Visible.

    Please help with where to set the font size.

    Thanks,
    Dave 

    <LabelsAppearance DataFormatString="{0}" RotationAngle="0">
        <TextStyle Bold="false" FontFamily="Helvetica" Color="Black" FontSize="12" Italic="false" Margin="0" Padding="0" />
    </LabelsAppearance>
  2. MasterChiefMasterChef
    MasterChiefMasterChef avatar
    152 posts
    Member since:
    Jan 2013

    Posted 21 Feb 2013 Link to this post

    Hi Dave,

    It looks like you need help setting the appearance and styling properties of the X Axis label inside of a RadHTMLChart. Take a look at this page in the RadHTMLChart documentation on how to properly change the font settings of a label. The code at the bottom should be enough for you to work off of.

    Hopefully this helps,
    Master Chief
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave
    Dave avatar
    13 posts
    Member since:
    May 2012

    Posted 21 Feb 2013 Link to this post

    Hi Master Chief,

    Thanks for the reply.

    I was looking at that page earlier and could not get it to work in my code. Does it make a difference if I am setting the x-axis labels dynamically on page load? Like this:

    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RadHtmlChart1.PlotArea.XAxis.DataLabelsField = "ActDate"
        RadHtmlChart1.PlotArea.XAxis.LabelsAppearance.RotationAngle = "45"
    End Sub

    When I add this (as shown in the example):

    <XAxis>
        <LabelsAppearance>
            <TextStyle Color="Green" FontFamily="Arial" Italic="true" FontSize="20" />
        </LabelsAppearance>
    </XAxis>

    to my .aspx page, the following error is thrown:
     
    'Telerik.Web.UI.HtmlChart.PlotArea.AxisLabelsAppearance' does not have a public property named 'TextStyle'.

    Thanks,
    Dave
Back to Top