Page 2 of 2

Chart - Autoscale axis

Posted: Tue Oct 17, 2006 10:28 am
by Vital
Please use in version from 10.17.2006 following code in ProcessChartEvent of chart:

Code: Select all

Stimulsoft.Report.Chart.StiChart chart = sender as Stimulsoft.Report.Chart.StiChart;
Stimulsoft.Report.Chart.StiSeries series = chart.Series[0];
			
double dMax = double.MinValue;
double dMin = double.MaxValue;

foreach (double d in series.Values)
{
	dMin = Math.Min(d, dMin);
	dMax = Math.Max(d, dMax);
}

((Stimulsoft.Report.Chart.StiAxisArea)chart.Area).YAxis.Range.Minimum = dMin;
((Stimulsoft.Report.Chart.StiAxisArea)chart.Area).YAxis.Range.Maximum = dMax;
((Stimulsoft.Report.Chart.StiAxisArea)chart.Area).YAxis.Range.Auto = false;
Thank you.

Chart - Autoscale axis

Posted: Wed Oct 18, 2006 2:34 am
by IanMcCarthy
Got it, just what I was looking for.

Great work.

Ian