Page 1 of 1

tzdHorizontal zoom problem

Posted: Wed Jun 02, 2004 8:12 am
by 9337201
Hello,

I am having difficulty with zooming especially when calculating Y custom axes. For each of my series I am re-scaling it's axis based on the Zoom Rect returned, for example:

with Chart1.Series[SeriesIdx].GetVertAxis do
begin
SetMinMax(
CalcPosPoint(Chart1.Zoom.Y1),
CalcPosPoint(Chart1.Zoom.Y0));
end;

My problem arises when the user activates the option to zoom along the X-Axis only, I use the tzdHorizontal direction setting to achieve this. When the user completes the selection of the zoom region the Chart1.Zoom.Y1 value is incorrect, it does not represent the bottom of my ChartRect and of course any series at the bottom of the chart are scaled off.

Is this a known problem? Does anyone have any idea how I may work around this without resorting to writing my own zoom selection tool?

Many thanks,

Steve

More info on tzdHorizontal zooming

Posted: Wed Jun 09, 2004 8:57 am
by 9337201
Hi all,

I'm still having problems with the tzdHorizontal direction, I'm hoping this may clarify my situation. The problem only seems to exist when each series has it's own axis, my example has them configured as follows:

Axis1 := (Chart1.CustomAxes.Add as TChartAxis);
Axis1.Horizontal:=false;
Axis1.PositionPercent:= 0;
Axis1.StartPosition := 0;
Axis1.EndPosition := 49;
Axis1.Axis.Color := Series1.SeriesColor;

Axis2 := (Chart1.CustomAxes.Add as TChartAxis);
Axis2.Horizontal:=false;
Axis2.PositionPercent:= 0;
Axis2.StartPosition := 50;
Axis2.EndPosition := 100;
Axis2.Axis.Color := Series2.SeriesColor;

Axis3 := (Chart1.CustomAxes.Add as TChartAxis);
Axis3.Horizontal:=false;
Axis3.PositionPercent:=-15;
Axis3.StartPosition := 0;
Axis3.EndPosition := 100;
Axis3.Axis.Color := Series3.SeriesColor;

I am having this problem because the user can switch between tzdHorizontal and tzdBoth by pressing the Shift key when zooming.

OnZoom when direction is tzdHorizontal TChart1.ChartRect.Top <> TChart.Zoom.Y0 and TChart1.ChartRect.Bottom <> TChart1.Zoom.Y1 surely these should be equal?

Any help would be appreciated.

Cheers

Steve