We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Automatic ranges question

Thread ID:





21288 Nov 5,2004 11:38 AM Nov 20,2009 01:24 PM Windows Forms 5
Tags: Chart
Administrator [Syncfusion]
Asked On November 5, 2004 11:38 AM

I have a chart that I know will have only positive values for the Y axis. I don''t know what the maximum value will be. How can I make my chart automatically determine the Y axis range but force it to always start at zero? ie. have a minimum range value of 0. As it is right now, the Y axis always has a lower (minimum) range that starts from negative 1000 although the data is ALWAYS positive! I need it to start at zero yet automatically determine the maximum value.

Davis Jebaraj [Syncfusion]
Replied On November 8, 2004 10:14 AM

Hi, You can explicitly set the Min of the AxisRange to be 0. Please refer to the sample linked to below: http://www.syncfusion.com/support/user/uploads/chartaxisrangeadjust.zip this.chartControl1.PrimaryYAxis.DimensionsChanged += new EventHandler(this.YAxisChangedHandler); private void YAxisChangedHandler(object sender, EventArgs e) { AdjustYAxis(); } private void AdjustYAxis() { this.chartControl1.PrimaryYAxis.Range.Min =0; } Thanks, Davis

Administrator [Syncfusion]
Replied On November 8, 2004 10:54 AM

Thanks Davis. Is it me or does it not seem a little strange that if I set the minimum Y axis value to something one time, that I should have to keep checking (via the changehandler) and keep resetting it? What if I set it in the property page? Do I then need to have a changehandeler to keep resetting it? Kinda defeats the purpose of setting the property in the first place does it not?

Davis Jebaraj [Syncfusion]
Replied On November 8, 2004 10:28 PM

Hi, The alternative would be to set the RangeType to be ChartAxisRangeType.Set In this case, the Range will not be automatically recomputed if the data changes. The approach with the event handling does not disable the automatic range calculation. Thanks, Davis

Replied On January 11, 2008 03:21 PM

I think this is a really useful post and I was wondering if perhaps it could be put into an FAQ... or better yet, fix the search in the forums so this doesn't take me an hour to find this information... Just some thoughts

Aymiee Lee
Replied On November 20, 2009 01:24 PM

Setting the RangeType to be ChartAxisRangeType.Set is not recomputing the range type.

on the same chartcontrol:
A - user runs first report: double on X axis and double on Y axis
B - user runs second report: date on X axis and double on Y axis.

Even though I use ChartAxisRangeType.Set, somehow the rangetype still thinks it is plotting double on X when its it is supposed to be date.

how do I recompute the rangetype other than using ChartAxisRangeType.Set?

ChartAxisRangeType.Auto does not work either.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.