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

Automatically format axis labels when numbers get too large

3 Answers 115 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Karim
Top achievements
Rank 1
Karim asked on 19 Feb 2009, 04:34 PM
Is there a way to automatically convert the axis labels into exponential form when the numbers get too large? On my Y axis, I have values ranging from 0 all the way up to 90000000000. It would be nice if, after the length of the value got to be bigger than say 5, that it would covert the label to 9e10 or something similar. Otherwise, it starts messing with the formatting of the rest of the chart.

3 Answers, 1 is accepted

Sort by
0
Karim
Top achievements
Rank 1
answered on 19 Feb 2009, 11:03 PM
I tried the following:

chart1.PlotArea.YAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.Scientific;

but that still carries with it a lot of decimal points (e.g. 9.000000E-10), which ends up making the label take just as much space as it did otherwise. Is there a way to specify what decimal place it should round to?
0
Accepted
Ves
Telerik team
answered on 20 Feb 2009, 08:03 AM
Hello Karim,

You can set the CustomFormat property to any valid Standard Numeric Format String or Custom Numeric Format String. For example:
chart1.PlotArea.YAxis.Appearance.CustomFormat = "0.###E+0"

Hope this helps.

Greetings,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Karim
Top achievements
Rank 1
answered on 20 Feb 2009, 11:35 PM
Had read about custom formats earlier, but had forgotten. Thanks!
Tags
Chart (Obsolete)
Asked by
Karim
Top achievements
Rank 1
Answers by
Karim
Top achievements
Rank 1
Ves
Telerik team
Share this question
or