How To SET The Value of AxisY Starts from ZERO When AutoScale or Autorange is TRUE

4 posts, 0 answers
  1. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 07 Feb 2011 Link to this post

    Hi Team,

    I am using silverlight radChart and i am binding the data source to chart and it is working as expected the problem here i am facing is?
    The AxisY does not start from Zero(Minimum value is not Zero).

    For example the data set contains values like 200,500,700,600,800........some thing like that then it automatically adjusting
    The minimum value of AxisY(AxisY starting value)is 100 and Maximum values of AxisY(AxixY ending value)is 1000..something like that.

    For adjusting the AxisY minimum values as Zero we have a property like AxisY.minimumvalue=0 this will work when will set autoscale or autorange as FALSE.
    My requirement is The AxisY starts with Zero and want to enable the auto scaling or auto range is TRUE.
    Both are not working.

    I need this as soon as possible please help me.I hope will get the replay soon.

    Thanks in Advance
    Vijay Kommalapati
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 09 Feb 2011 Link to this post

    Hi vijay,

    In addition to turning off the autoscaling of the YAxis, you can also specify that the axis is zero based. This can be done by setting:

    RadChart1.DefaultView.ChartArea.AxisY.IsZeroBased = true;

    Also, you can turn onff the autoscaling, and set the axis range manually:

    RadChart1.DefaultView.ChartArea.AxisX.AutoRange = false;
    RadChart1.DefaultView.ChartArea.AxisX.AddRange(0, 10, 1);

    I hope that one of these options is suitable for you.

    Kind regards,
    Yavor
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. vijay
    vijay avatar
    46 posts
    Member since:
    Jul 2010

    Posted 09 Feb 2011 Link to this post

    Ok thanks for your replay i am fine with AxisY starts from ZERO

    With
    chartArea.AxisY.AutoRange =
    true;
    chartArea.AxisY.IsZeroBased =
    true;
     
    Here i was set the autorange as true so it is behaving diffarently like some times getting 3 Yaxis ticks and some times getting 4 yaxis ticks.

    My requiremtn is i want to fix the tics for all the scenarios when ever have to set the autorange as true.

    Observe the attached graphs

    Attachment 1 contains 3 Tic values like $0.00,$5,000.00,$10,000.00.
    Attachment 2 contains 4 Tic values like 0,10,20,30. 

    I am not defining anywhere have to behave like that and i want to control the tic values. 

    Observe the above 2 cases graph1 generates 3Tic values and Graph2 contains 4Tic values for AxisY.
    I have to set the Tic value for all the scenarios as 5 something like that fixed.

    The solutions i am thinking here is have to set the stepvalue but i don't know how to manage that. can you please help me how to meet my requiremnt here.
    i am not using any max and min values here,Just i am binding my dataset to graph.

    Thanks
    Vijay Kommalapati
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 11 Feb 2011 Link to this post

    Hi vijay,

    Basicaly, in such a setup, when the chart control autoranges the axis, you cannot set the ticks at equal intervals. The reason for this is that there are many factors which are included - the data received by the control, the available width and height. Although one can manipulate the steps for the axis, there is no precise algorith to ensure that both ranges will match. The only option in such a case is to disable the autorange for the axis, and set the values manually.
    I hope this information helps.

    Greetings,
    Yavor
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top