How do you set minimum for Y-Scale (regular way does not work)

Thread is closed for posting
12 posts, 0 answers
  1. Maciej Pilichowski
    Maciej Pilichowski avatar
    8 posts
    Member since:
    May 2010

    Posted 30 Sep 2010 Link to this post

    I have RadChart with 30 items on X scale. They all have values 0, and I am not showing it (visible=false). I am doing it because I would like to show empty char, but with correct scale (if you don't add any items, there will be red label in center with text about missing data).

    So far, so good. But the problem is the chart Y scale goes by default from -50 to +50. And now is my question -- how do you change it, to go from 0, to default (50 is fine)?

    I added in ascx file the tags

    <PlotArea>

    <YAxis2 MinValue=0></YAxis2>
    <YAxis MinValue=0></YAxis>

    </PlotArea>

    It does not work. So I added the equivalent of this in C# code, just after adding data. Still, no change. So how do you set this min value for Y scale?

  2. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 30 Sep 2010 Link to this post

    Hi Maciej,

    The RadChart is calculating the Axis Range by taking the zero and data values. In your case where all the values are zeroes RadChart can't find two points to calculate range from them. That's why it is showing -50.. 50 on YAxis. You can easily change this by setting AutoScale to False and manually set the MinValue, MaxValue and Step. For example MinValue=0; MaxValue =50 and Step =10. For more information take a look at our help topic - http://www.telerik.com/help/aspnet-ajax/understandingelementsaxes.html.

    I hope this helps.

    Regards,
    Evgenia
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Maciej Pilichowski
    Maciej Pilichowski avatar
    8 posts
    Member since:
    May 2010

    Posted 01 Oct 2010 Link to this post

    Uh-oh, thank you. I missed AutoScale property. Problem solved.
  4. eugen100
    eugen100 avatar
    34 posts
    Member since:
    Mar 2007

    Posted 28 May 2011 Link to this post

    Hello,
    My question is close to the theme of this thread so I decided do not open a new one. I have, for example, XValues of a series as
    [-5,...,5]. If I use AutoLayout="true" then I get on Xaxis exactly these bounds. But if, for example,XValues  are between 2 and 5 then in Radchart I get a zero as a left bound of Xaxis. I know that I can change "AutoScale to False and manually set the MinValue, MaxValue and Step". But in these case I lose all preferences of  AutoLayout="true". Is it possible to find other soluton so that I won't lose power of AutoScale ?
  5. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 31 May 2011 Link to this post

    Hi Evgeny,

    We are not able to reproduce such behavior - "lose the preferences of AutoLayout turned on when AutoScale is false".
    The sample project attached is created with the latest binaries of our control and everything works as expected.

    All the best,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. eugen100
    eugen100 avatar
    34 posts
    Member since:
    Mar 2007

    Posted 01 Jun 2011 Link to this post

    Hi Evgenia ,
    I think that I understood your point:
     If we want that XAxis bounds will be according to xmin,xmax and not include zero
    we should define
    AutoScale = false
    and
    XAxis.AddRange(xmin,xmax,step)
    It supposes that we define step ourselves. I really wanted to avoid this that is I thought that

    AutoLayout =

    true

     

    will make it. But it seems that avoiding of step defining (by computing it according to bounds (xmin,xmax)) is not impossible.
    Thank you
    Evgeny
  7. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 03 Jun 2011 Link to this post

    Hello Evgeny,

    AutoLayout property functionality instructs the control to perform layout arrangement automatically for optimal utilization of the elements. It has nothing in common with the Axes - it just controls the appearance of the elements that are not part of the PlotArea (Chart Title, Legend and Axis Labels).
    Even if you provide only the MinValue and MaxValue values for the XAxis without specifying the Step - it will be automatically set to 1 (the default value).

    Kind regards,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  8. eugen100
    eugen100 avatar
    34 posts
    Member since:
    Mar 2007

    Posted 05 Jun 2011 Link to this post

    Hello Evgenia.
    You wrote:
    >Even if you provide only the MinValue and MaxValue values for the XAxis without specifying the Step - it will be automatically set to 1 (the default value).
    Exactly, and this is my point: step equal to 1 is not acceptable for big range. So I should compute and set it by myself. I don't say that it is bug - it is a feature.  But if you should not always include zero into X range when  AutoLayout="true" and AutoScale=true then I wouldn' t change AutoScale to false and so I would not have to compute the step.
    Thank you
    Evgeny
  9. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 08 Jun 2011 Link to this post

    Hi Evgeny,

    I'm afraid I don't understand your frustrations. AutoLayout property works independently from the AutoScale property - no matter if you provided custom Range or automatic Range for the Axes. For all our users that want to avoid the 0 value to be plotted - they can set custom Range for the Axes and yes they should calculate the Step on their own.
    Once again - the AutoLayout property does not controls the Step of the axes.

    Kind regards,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  10. eugen100
    eugen100 avatar
    34 posts
    Member since:
    Mar 2007

    Posted 09 Jun 2011 Link to this post

    Hello Evgenia,
    I think that I understood you: only AutoScale property controls the Step of the axes. So "my frustrations" is about: why AutoScale =true does include zero  to be plotted ? It might be more comfortable if xMin and xMax were defined automatcally.
    Thank you
    Evgeny
  11. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 15 Jun 2011 Link to this post

    Hi Evgeny,

    I'm sorry for omitting to mention the IsZeroBased property of the Chart. You can set it to false and this way the zero won't be displayed. This property works only when the AutoScale is set to true.

    I hope this helps you.

    Kind regards,
    Evgenia
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  12. eugen100
    eugen100 avatar
    34 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2011 Link to this post

    Thank you, it really helps.
Back to Top