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

Formatting axis labels

3 Answers 108 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Vivian Hu
Top achievements
Rank 1
Vivian Hu asked on 11 Feb 2010, 07:41 PM

Hi,

I have a horizontal bar chart. X-axis (the vertial one) shows 1, 2, 3, 4. And the Y-axis (the horizontal one) shows 0, 0.1, 0.2, 0.3

I tried to format the Y-axis labels as percentage with 1 decimal, as following:

myChart.PlotArea.YAxis.Appearance.CustomFormat = "#.0%"
It didn't work. Actually, I've tried in several ways, it kept showing 0.00%  10.00% ... Always gave me 2 decimals. However, when I tried it on the X-axis, it worked (gave me 100.0%  200.% ... 400.0%)
Anybody knows what's wrong?

Second, could anyone please tell me how to hide the axis labels? I don't want to show 1, 2, 3, 4 along the X-axis.

Thanks,
Vivian

3 Answers, 1 is accepted

Sort by
0
Vivian Hu
Top achievements
Rank 1
answered on 11 Feb 2010, 08:01 PM
I've already found the answer to the 2nd:

.PlotArea.XAxis.Appearance.LabelAppearance.Visible =

False

 


0
Ves
Telerik team
answered on 15 Feb 2010, 08:19 AM
Hello Vivian,

The line you have provided seems to work fine for me. Please, make sure you have not set the myChart.PlotArea.YAxis.Appearance.ValueFormat property  to Telerik.Charting.Styles.ChartValueFormat.Percent. Leave the CustomFormat property only.

Best regards,
Ves
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.
0
Vivian Hu
Top achievements
Rank 1
answered on 17 Feb 2010, 03:42 PM

Thanks a lot. In the chart wizard, I had set the axis value format to percent. I've already set it back to none, but it didn't work. Then I changed a skin, everything is fine now. I guess the system restored its default settings.

Thanks,

Vivian

Tags
Chart (Obsolete)
Asked by
Vivian Hu
Top achievements
Rank 1
Answers by
Vivian Hu
Top achievements
Rank 1
Ves
Telerik team
Share this question
or