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

Is DataFormatString broken?

2 Answers 97 Views
Chart (HTML5)
This is a migrated thread and some comments may be shown as answers.
DuelingCats
Top achievements
Rank 2
DuelingCats asked on 03 Dec 2012, 03:12 PM
I am setting a label DataFormatString for my line series and I noticed that it is not taking effect. The datasource I am providing to the chart contains a score as a double. I wanted to provide the {0:F} formatter so that I do not display unnecessarily long precision. 

With the following markup:
<LabelsAppearance DataFormatString="{0:F}">
    <TextStyle Bold="true" Color="#003366" />
</LabelsAppearance>

If the data is 56.1, the label is 56

With this markup:
<LabelsAppearance>
    <TextStyle Bold="true" Color="#003366" />
</LabelsAppearance>

If the data is 56.1, the label is 56.1

Is my data format string incorrect, or is it just not working?

2 Answers, 1 is accepted

Sort by
0
Accepted
Danail Vasilev
Telerik team
answered on 03 Dec 2012, 05:24 PM
Hello,

Indeed, the F format string is not working within RadHtmlChart in the current version of RadControls. This bug has already been logged in our PITS here, so that you can monitor its progress, comment and vote on it.

For the time being you can use the N format string which has the same effect as F format string(e.g. DataFormatString="{0:N2}")

Regards,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
DuelingCats
Top achievements
Rank 2
answered on 03 Dec 2012, 05:25 PM
Thanks, I will use the N formatter for now. 
Tags
Chart (HTML5)
Asked by
DuelingCats
Top achievements
Rank 2
Answers by
Danail Vasilev
Telerik team
DuelingCats
Top achievements
Rank 2
Share this question
or