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

Format X-axis Label

2 Answers 193 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 21 Feb 2013, 06:55 PM
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 Answers, 1 is accepted

Sort by
0
MasterChiefMasterChef
Top achievements
Rank 2
answered on 21 Feb 2013, 08:49 PM
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
0
Dave
Top achievements
Rank 1
answered on 21 Feb 2013, 09:42 PM
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
Tags
Chart (Obsolete)
Asked by
Dave
Top achievements
Rank 1
Answers by
MasterChiefMasterChef
Top achievements
Rank 2
Dave
Top achievements
Rank 1
Share this question
or