TAChart: Fix usage of axistransformations in ChartLiveView having ExtentY = lveAuto.

git-svn-id: trunk@65423 -
This commit is contained in:
wp 2021-07-08 23:18:14 +00:00
parent 2d8041f71d
commit c19e36a6e7

View File

@ -101,13 +101,14 @@ var
w: double;
i: Integer;
ymin, ymax: Double;
ygmin, ygmax: Double;
ser: TChartSeries;
begin
if not FChart.ScalingValid then
exit;
fext := FChart.GetFullExtent();
lext := FChart.LogicalExtent;
w := lext.b.x - lext.a.x;
if FViewportSize = 0 then
w := lext.b.x - lext.a.x
else
@ -121,15 +122,20 @@ begin
case FExtentY of
lveAuto:
begin
ymin := Infinity;
ymax := -Infinity;
ygmin := Infinity;
ygmax := -Infinity;
for i := 0 to FChart.SeriesCount-1 do
if FChart.Series[i] is TChartSeries then
TChartSeries(FChart.Series[i]).FindYRange(lext.a.x, lext.b.x, ymin, ymax);
if (ymin <> Infinity) and (ymax <> -Infinity) then
begin
ser := TChartSeries(FChart.Series[i]);
ser.FindYRange(lext.a.x, lext.b.x, ymin, ymax);
ygmin := Min(ygmin, ser.AxisToGraphY(ymin));
ygmax := Max(ygmax, ser.AxisToGraphY(ymax));
end;
if (ygmin <> Infinity) and (ygmax <> -Infinity) then
begin
lext.a.y := ymin;
lext.b.y := ymax;
lext.a.y := ygmin;
lext.b.y := ygmax;
end;
end;
lveFull: