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

Series Label in charts

3 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rap
Top achievements
Rank 1
rap asked on 24 Jun 2011, 11:13 AM
Hello,

I'm very new in telerik applications. I'm working on the charts part. I need to do an upgrade to something already existing.
I attached a picture of what is currently existing. As you can see there is a series label on the top of each bar (the value). I would like to know if it is possible to add an second label (above or below the other one). for example, a pourcentage.

If possible, could you please give some guidelines to help me ?

Thank you !

3 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 24 Jun 2011, 11:24 AM
Hi rap,

By default the chart item will display the value corresponding to the bar (point, slice) as a label, but you can control the label content. This is possible thanks to the DefaultLabelValue property - you can use several “special words” in this property -- "#Y", "#X", “#%”, “#SUM”, “#STSUM”, “#SERIES”, “#ITEM”. They are all listed in the dedicated help topic . If you want to further customize this label, you can combine them: DefaultLabelValue=”#Y (#%)”. This will produce a label like “2314 (34%)”.
You can add any Standard Numeric Format String inside curly braces. Here is an example - remove the decimals from the amount but specify the percentage with higher precision: “#Y{C0} (#%{#0.###%})”.

All the best,
Steve
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
rap
Top achievements
Rank 1
answered on 24 Jun 2011, 12:50 PM
Thank you very much for your answer ! It is really helpful. I just have a last question : so now I know it's possible, but I would like to know if I can show this 2 values on 2 lines.
for example :
254
20%

instead of 254 - 20%

Cause, it's quite large (2 values on the same line).
0
Accepted
Steve
Telerik team
answered on 24 Jun 2011, 01:37 PM
Hello rap,

You can, but you would have to set the DefaultLabelValue with code e.g.:

chart1.Series[0].DefaultLabelValue = "#Y{N0}" + Environment.NewLine + "(#%)";

Regards,
Steve
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
Tags
General Discussions
Asked by
rap
Top achievements
Rank 1
Answers by
Steve
Telerik team
rap
Top achievements
Rank 1
Share this question
or