This is a migrated thread and some comments may be shown as answers.
Autosize y axis?
4 Answers 70 Views
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 06 Jan 2009, 09:32 AM
Hi,

I have a chart which can have a number of different series plotted with a numerical y axis and a datetime x axis.  The majority of the y axis points will be clustered around a certain value, say in the range 110-120.  I have set AutoScale to true on the y-axis, but it still starts at 0 and goes up to around 120.  Is there anything I can do to automatically limit the y axis to cover just the plotted values? i.e. start at 100, end at 120 for example.  I could find the min and max y value amongst all my series and set the MinValue and MaxValue properties but this is time consuming when I have large series of several hundred items.

Thanks in advance.

4 Answers, 1 is accepted

Sort by
0
Accepted
Ves
Telerik team
answered on 07 Jan 2009, 08:21 AM
Hello Jonathan,

There are two ways you can approach this:
  • Set IsZeroBased property of YAxis to false and let RadChart calculate the MinValue, MaxValue and Step for you. This way the axis will show only the relevant range according to the series data.
  • Set AutoScale property to false. Now you must provide MinValue, MaxValue and Step or use AddRange method to populate the Y axis. Virtually, it is the same effort as this method needs the values for these properties as parameters.
As the second approach requires you to know the min and max value, I would suggest that you go for the first one. Hope this helps.
 
Regards,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jonathan
Top achievements
Rank 1
answered on 07 Jan 2009, 08:40 AM
Thanks, I had no idea that IsZeroBased property existed.  That has solved my problem.

Thanks again.
0
toby
Top achievements
Rank 1
answered on 30 Jan 2011, 05:58 PM
Hello
This thread was a really useful find. Could you please help me with an issue that continues from this. My chart has correctly scaled my Y axis with a maximum value 0f 6 howvever as i am using a spline chart the top curve of the spline goes off the top and is hidden. Can i override or add 1 to the maximum Y value so that the spline does not dissappear?

Thanks
Toby
0
Ves
Telerik team
answered on 02 Feb 2011, 02:55 PM
Hello Jonathan,

I believe this article provides the answer -- YAixs.AxisMode property allows you to configure the Y axis as needed.

Kind regards,
Ves
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.
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Ves
Telerik team
Jonathan
Top achievements
Rank 1
toby
Top achievements
Rank 1
Share this question
or