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

DataLabelValue Formatting not working

1 Answer 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
paul
Top achievements
Rank 1
paul asked on 14 Dec 2010, 08:38 PM

 

 

I am using a cubedatasource and trying to format the data labels, but the format doesn't seem to take effect.  I am adding the series in the codebehind:

 

ChartSeries series = new ChartSeries("Avg Hours/Job", ChartSeriesType.Bar);
series.DataYColumn = "JobAvg";
series.DataLabelsColumn = "JobAvg";
series.DefaultLabelValue = "#Y{F}";
cht.Series.Add(series);

I am still getting values with 8 decimal places.  Anyone know why?

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 20 Dec 2010, 05:55 PM
Hi Paul,

Please, remove the line that sets DataLabelsColumn. This interferes with DefaultLabelFormat which needs the value from the DataYColumn (through the #Y token) as a numeric value, so that the format is applied. DataLabelsColumn is intended for cases, where one would need a string label, taken from a completely different column.


Kind regards,
Ves
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
paul
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or