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

percent in chart

1 Answer 100 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Carsten
Top achievements
Rank 1
Carsten asked on 05 May 2009, 09:07 PM
I switched my line chart to percent with this piece of code:

RadChart2.PlotArea.YAxis.Appearance.ValueFormat = Telerik.Charting.Styles.

ChartValueFormat.Percent;

Now the line shows the correct values, but the scale show for example 3.500,00%. If I divide my input value with 100 the scale is right (35%) but the line shows 0.33%. Do I need to set something else for displaing percent?

 

1 Answer, 1 is accepted

Sort by
0
Dessy
Telerik team
answered on 07 May 2009, 12:14 PM
Hello ,

ValueFormat  value which you use is a correct one for displaying percentage, but this format causes the number to be multiplied by 100 before it is formatted. So to avoid this situation I would recommend you to set CustomFormat property and then use escape character before '%'  

RadChart.PlotArea.YAxis.Appearance.CustomFormat = "#0.##\\%";

For more information regarding "Custom Numeric Format Strings", you can visit this article.
As for Item Labels values, you could use DefaultLabelValue property set to '#Y%' which will display your values in percentage format. 

RadChart.Series[0].DefaultLabelValue = "#Y%";

Hope this helps.

All the best,
Dessy
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.
Tags
Chart (Obsolete)
Asked by
Carsten
Top achievements
Rank 1
Answers by
Dessy
Telerik team
Share this question
or