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.
DJDavis Jebaraj Syncfusion Team November 8, 2004 10:14 AM
You can explicitly set the Min of the AxisRange to be 0. Please refer to the sample linked to below:
this.chartControl1.PrimaryYAxis.DimensionsChanged += new EventHandler(this.YAxisChangedHandler);
private void YAxisChangedHandler(object sender, EventArgs e)
private void AdjustYAxis()
ADAdministrator Syncfusion Team November 8, 2004 10:54 AM
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?
DJDavis Jebaraj Syncfusion Team November 8, 2004 10:28 PM
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.
JEJeff January 11, 2008 03:21 PM
Hi, 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
ALAymiee LeeNovember 20, 2009 01:24 PM
Setting the RangeType to be ChartAxisRangeType.Set is not recomputing the range type.
example... 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?