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

YAxis formatting

1 Answer 44 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 07 May 2012, 09:17 PM
I'm trying to format numbers in the Y axis to 1 decimal.  If I do:
 RadChart1.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.None;
 RadChart1.PlotArea.YAxis.Appearance.CustomFormat = "##.0";
it works(it shows a label with a value of 39.00 as 39.0)

 If I do:
 RadChart1.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.Number;
RadChart1.PlotArea.YAxis.Appearance.CustomFormat = "##.0";
it doesn't work (it shows a label with a value of 39.00 as 39.00)

but in the X axis this special custom format works fine (2 lines with the right custom format):
 RadChart1.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.LongDate;
RadChart1.PlotArea.YAxis.Appearance.CustomFormat = "HH:mm\nM/dd";
is the ChartvalueFormat.None required for CustomFormats in the Y axis?
Thanks


1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 10 May 2012, 11:29 AM
Hi George,

Both X and Y axes work the same way. When ValueFormat is numeric (i.e. one of Currency, Scientific, General, Number, Percent) CustomFormat is ignored. You can use None to apply custom numeric format. However, when ValueFormat is DateTime-related, CustomFormat is respected and this allows you to specify your own formatting for DateTime values.

Best regards,
Ves
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Chart (Obsolete)
Asked by
George
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or