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

Problem formatting labels

1 Answer 81 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
kizza
Top achievements
Rank 1
kizza asked on 01 Apr 2009, 10:34 AM
Hello,

I would like to change the labels above my bars to reflect money.

I tried to change the defaultlabelvalue like this: RadChart.Series[0].DefaultLabelValue = something

I get a index out of range error.

When i lookup the amount of series i have in my graph, it shows 0 series, but i still have data.

How do i format the labels now?



1 Answer, 1 is accepted

Sort by
0
Dessy
Telerik team
answered on 03 Apr 2009, 11:00 AM
Hi kizza,

Actually your chart does have series.They could be created from the design view mode or when the chart is databound, or also programmatically.  If you use a databound chart, you should first  use DataBind method and then you could access the chart series and set DefaultLabelValue property. Otherwise the chart will not recognize the series and will generate the exception which you receive.
In order to display labels with currency you should set DefaultLabelValue to "#Y{C}" where ,"#Y" display numbers from the Y axis respectively and C is equal to Currency.

RadChart1.Series[0].DefaultLabelValue=
"#Y{C}";
 

You can also use the formatting described in this MSDN article  Standard Numeric Formats . Use curly brackets to contain the standard numeric formats

Hope that helps.

Best wishes,
Dessy
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
kizza
Top achievements
Rank 1
Answers by
Dessy
Telerik team
Share this question
or