Large Numbers on Chart

5 posts, 1 answers
  1. Barry
    Barry avatar
    90 posts
    Member since:
    Jul 2011

    Posted 04 Apr 2013 Link to this post

    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?

  2. Answer
    Missing user
    Missing user avatar

    Posted 09 Apr 2013 Link to this post

    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.

  3. DevCraft banner
  4. Marcin
    Marcin avatar
    31 posts
    Member since:
    Jul 2013

    Posted 24 Jul 2013 Link to this post

    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
  5. Petar Kirov
    Admin
    Petar Kirov avatar
    425 posts

    Posted 25 Jul 2013 Link to this post

    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 >>
  6. Marcin
    Marcin avatar
    31 posts
    Member since:
    Jul 2013

    Posted 25 Jul 2013 Link to this post

    Thank You very much!
Back to Top
DevCraft banner