AutoRange Label - how to change the units

4 posts, 0 answers
  1. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 18 Oct 2012 Link to this post

    Hi..
    I have the following

    <charting:AxisY AutoRange="True" Title="kwh"
                                                       MinorTicksVisibility="Collapsed"
                                                       MajorTicksVisibility="Visible" />


    the values are like    60,000    70,000    100,000

    the Y axis looks like this

    100 k

    70 k

    60 k


    How can I remove or change the 'k' on the axis?   or put   (1000) on the bottom of the Y axis

    thx in advance
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 22 Oct 2012 Link to this post

    Hi Jon,

    Try setting the string format of the YAxis:
    this.radChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "N"; // N, F0

    Greetings,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Jon
    Jon avatar
    539 posts
    Member since:
    Apr 2004

    Posted 22 Oct 2012 Link to this post

    How can I format it with commas and no decimal places.. I tried the standard C# formating but doesn't work
    thx
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 23 Oct 2012 Link to this post

    Hello Jon,

    If you need to have a fuller control over the formatting you can check out this help topic. Here is some code to jump start you:
    this.radChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "#VAL{##,#}";

    All the best,
    Petar Marchev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top