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

Large Numbers on Chart

4 Answers 166 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Barry
Top achievements
Rank 1
Barry asked on 04 Apr 2013, 12:50 PM
I have a requirement to have numbers in the millions and billions on a chart and when I put them on the RadCartesianChart they end up looking like this: 5E+08 (for 500,000,000). Is there a way to get the chart to show 500,000,000? Or 25,000,000,000?

4 Answers, 1 is accepted

Sort by
0
Accepted
Missing User
answered on 09 Apr 2013, 07:06 AM
Hi Barry,

We support this functionality through the label format feature of RadChartView's axes. Setting a label format like this:
<telerik:LinearAxis LabelFormat="###,###,###" />
will override the scientific notation you've come across and will show 500 000 000 instead of 5E+08. This formatting is the standard one used by the .NET framework, as outlined in this topic on MSDN.

Greetings,
Ivan N.
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Marcin
Top achievements
Rank 1
answered on 24 Jul 2013, 10:41 AM
Hi,

Is there a simple way to format values in a way, it was done by default in previous varions of Charts. I mean e.g.:

600
800
1k
1,2k

or:
500 k
1 mil
1,5 mil

and so on?

Best regards
Marcin Danek
0
Petar Kirov
Telerik team
answered on 25 Jul 2013, 10:27 AM
Hi Marcin,

In order to achieve this you will need to plug in some custom logic that will apply different format on the axis labels depending on their value. This can be done by specifying a custom LabelTemplate that uses a converter to do the formatting:
<telerik:LinearAxis>
<telerik:LinearAxis.LabelTemplate>
 <DataTemplate>
  <TextBlock Text="{Binding Converter={StaticResource LabelFormatConverter}}"/>
 </DataTemplate>
</telerik:LinearAxis.LabelTemplate>
</telerik:LinearAxis>

I have attached a sample project demonstrating this.
I hope this helps.
 
Regards,
Petar Kirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Marcin
Top achievements
Rank 1
answered on 25 Jul 2013, 12:50 PM
Thank You very much!
Tags
ChartView
Asked by
Barry
Top achievements
Rank 1
Answers by
Missing User
Marcin
Top achievements
Rank 1
Petar Kirov
Telerik team
Share this question
or