Missing Zero in Y-Axis range

4 posts, 0 answers
  1. Madhan
    Madhan avatar
    19 posts
    Member since:
    Aug 2012

    Posted 14 Sep 2012 Link to this post

    Hello Team,


    We are using RadChart control to show Revenue and Unit graphs.In graph we have two series like VTB and YOY and we are trying to customize the  Y-Axix scale values based on Min and Max values of VTB and YOY .We are able to get Min and Max values of VTB and YOY and set range as below.


    ChartArea chartArea = objChartArrayMTD.BarChart.DefaultView.ChartArea;
    chartArea.AxisY.AutoRange = true;


    MinVal=-56 and MaxVal=50 and Step=25


    chartArea.AxisY.AddRange(MinVal, MaxVal, step);


    Once we set values like above me are missing 0 in Y-Axis values.Can you please send me solution ASAP?
  2. Sia
    Admin
    Sia avatar
    667 posts

    Posted 14 Sep 2012 Link to this post

    Hello Madhan Mamidala,

    The problem that you observe occurs because of the value that you set for minimum. RadChart will render y axis with 0 only if the manual range starts from value that is a multiple of the step value.

    Kind regards,
    Sia
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. DevCraft banner
  4. Madhan
    Madhan avatar
    19 posts
    Member since:
    Aug 2012

    Posted 14 Sep 2012 Link to this post

    Hello Sia,

    Thanks for your reply.Can you please assist me how can i get 0 with that give min=-56 and max=50?
  5. Sia
    Admin
    Sia avatar
    667 posts

    Posted 18 Sep 2012 Link to this post

    Hi Madhan,

    If you have MinValue = -56 and MaxValue = 50, that means that your range is 106 (=2x53). You need to choose 1 or 2 for step in order to have the 0 value displayed on your axis.
    Another option is to choose your step value depending on the minimum. For example you can choose Step = 14. But in that case you won't have the maximum value displayed with label.

    Kind regards,
    Sia
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Back to Top