Page 1 of 2
Chart - Autoscale axis
Posted: Thu Oct 12, 2006 8:56 am
by IanMcCarthy
Is it possible to get the y-axis to autoscale depending on the range of values being displayed?
I have data which sit around 70 to 140 so would like the chart to show only 70 to 140 not zero to 140.
Is this possible?
Many thanks
Ian
Chart - Autoscale axis
Posted: Thu Oct 12, 2006 12:02 pm
by Vital
You can use property Range - Axis.YAxis.Range.
This property avaialble only in version 2006.4
Thank you.
Chart - Autoscale axis
Posted: Mon Oct 16, 2006 3:18 am
by IanMcCarthy
I have a chart on a detail data band, so this gets presented several times each with a different data set.
Can I determine the current valid data range for each chart during the render event and modify the chart range from there?
Thereby always expanding the chart to show the maximum detail.
Many thanks
Ian
Chart - Autoscale axis
Posted: Mon Oct 16, 2006 4:48 am
by IanMcCarthy
I can't locate Range or even YAxis as a member of StiArea.
Range doesn't appear in the design view either.
Stimulsoft.Report.Chart.StiChart chart
chart.Area.???
Where exactly can I find the range member?
Chart - Autoscale axis
Posted: Mon Oct 16, 2006 8:18 am
by Vital
Please use following path:
((Stimulsoft.Report.Chart.StiAxisArea)chart.Area).XAxis.Range
Chart - Autoscale axis
Posted: Mon Oct 16, 2006 8:45 am
by IanMcCarthy
Get reference to chart object:
Stimulsoft.Report.Chart.StiChart chart = report.Pages[0].GetComponents()["Chart1"] as Stimulsoft.Report.Chart.StiChart;
Try to set new range (don't know if this is the right way because I can't find any relevant documentation)
((Stimulsoft.Report.Chart.StiAxisArea)chart.Area).XAxis.Range = new object[70, 140];
But compiler complains:
'Stimulsoft.Report.Chart.StiXAxis' does not contain a definition for 'Range'
Which is backed up by intellisense (no Range in list).
Ian
Chart - Autoscale axis
Posted: Mon Oct 16, 2006 10:17 am
by Edward
IanMcCarthy wrote:Get reference to chart object:
Stimulsoft.Report.Chart.StiChart chart = report.Pages[0].GetComponents()["Chart1"] as Stimulsoft.Report.Chart.StiChart;
Try to set new range (don't know if this is the right way because I can't find any relevant documentation)
((Stimulsoft.Report.Chart.StiAxisArea)chart.Area).XAxis.Range = new object[70, 140];
But compiler complains:
'Stimulsoft.Report.Chart.StiXAxis' does not contain a definition for 'Range'
Which is backed up by intellisense (no Range in list).
Ian
Sorry, but this code works only in StimulReport.Net 2006.4
You can download it from the following links:
http://www.stimulsoft.com/RegisteredUsers.aspx (for registered users)
http://www.stimulsoft.com/DownloadsSR.aspx (demo versions)
Thank you.
Chart - Autoscale axis
Posted: Tue Oct 17, 2006 6:21 am
by IanMcCarthy
OK, updated to latest demo dlls and range is now available.
I want to set the range based upon the actual values of the YAxis data as the detail chart is drawn.
When I put code in the BeginRender event of the databand, the data series in the chart is still the demo data [1, 2, 3] not my sql data.
Can I achieve this?
Ian
Chart - Autoscale axis
Posted: Tue Oct 17, 2006 7:09 am
by Edward
Please send your report to

for analysis. If it is possible please provide your data for the chart (in any format).
Thank you.
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.