Axis min/max for visible data only
Posted: Wed Jul 25, 2007 1:52 pm
In the sample code below the rs contains 12400 records.
I set the bottom axis so I am only displaying the last 260 points.
How can I get the chart to scale the left axis to the maximum and minimum values visibly displayed?
#SAMPLE
With tc
.Environment.MouseWheelScroll = False
.RemoveAllSeries
.AddSeries scLine
.Axis.Left.MaximumOffset = 10
.Axis.Left.MinimumOffset = 10
.Series(0).VerticalAxis = aLeftAxis
.Series(0).DataSource = rs
.Series(0).YValues.ValueSource = "prClose"
.Axis.Bottom.SetMinMax (rs.RecordCount - 260), rs.RecordCount
#THE NEXT LINE SCALES ACCORDING TO THE WHOLE SERIES
.Axis.Left.SetMinMax .Series(0).YValues.Minimum, .Series(0).YValues.Maximum
End With
I set the bottom axis so I am only displaying the last 260 points.
How can I get the chart to scale the left axis to the maximum and minimum values visibly displayed?
#SAMPLE
With tc
.Environment.MouseWheelScroll = False
.RemoveAllSeries
.AddSeries scLine
.Axis.Left.MaximumOffset = 10
.Axis.Left.MinimumOffset = 10
.Series(0).VerticalAxis = aLeftAxis
.Series(0).DataSource = rs
.Series(0).YValues.ValueSource = "prClose"
.Axis.Bottom.SetMinMax (rs.RecordCount - 260), rs.RecordCount
#THE NEXT LINE SCALES ACCORDING TO THE WHOLE SERIES
.Axis.Left.SetMinMax .Series(0).YValues.Minimum, .Series(0).YValues.Maximum
End With