mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 13:59:10 +02:00
TAChart: Check that Chart.Extent buonds are ordered corectly.
git-svn-id: trunk@19604 -
This commit is contained in:
parent
56cc734a27
commit
a258bd419f
@ -1241,6 +1241,7 @@ begin
|
|||||||
FYGraphMax := FCurrentExtent.b.Y;
|
FYGraphMax := FCurrentExtent.b.Y;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
Extent.CheckBoundsOrder;
|
||||||
|
|
||||||
// Search # of points, min and max of all series
|
// Search # of points, min and max of all series
|
||||||
FXGraphMin := Infinity;
|
FXGraphMin := Infinity;
|
||||||
|
@ -241,6 +241,8 @@ type
|
|||||||
property Visible default true;
|
property Visible default true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
EExtentError = class(EChartError);
|
||||||
|
|
||||||
{ TChartExtent }
|
{ TChartExtent }
|
||||||
|
|
||||||
TChartExtent = class (TChartElement)
|
TChartExtent = class (TChartElement)
|
||||||
@ -253,6 +255,7 @@ type
|
|||||||
procedure SetBounds(AIndex: Integer; const AValue: Double);
|
procedure SetBounds(AIndex: Integer; const AValue: Double);
|
||||||
procedure SetUseBounds(AIndex: Integer; AValue: Boolean);
|
procedure SetUseBounds(AIndex: Integer; AValue: Boolean);
|
||||||
public
|
public
|
||||||
|
procedure CheckBoundsOrder;
|
||||||
property Extent: TDoubleRect read FExtent;
|
property Extent: TDoubleRect read FExtent;
|
||||||
published
|
published
|
||||||
property XMin: Double index 1 read GetBounds write SetBounds;
|
property XMin: Double index 1 read GetBounds write SetBounds;
|
||||||
@ -780,6 +783,20 @@ begin
|
|||||||
Result := FUseBounds[AIndex];
|
Result := FUseBounds[AIndex];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TChartExtent.CheckBoundsOrder;
|
||||||
|
begin
|
||||||
|
if UseXMin and UseXMax and (XMin >= XMax) then begin
|
||||||
|
UseXMin := false;
|
||||||
|
UseXMax := false;
|
||||||
|
raise EExtentError.Create('ChartExtent: XMin >= XMax');
|
||||||
|
end;
|
||||||
|
if UseYMin and UseYMax and (YMin >= YMax) then begin
|
||||||
|
UseYMin := false;
|
||||||
|
UseYMax := false;
|
||||||
|
raise EExtentError.Create('ChartExtent: YMin >= YMax');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TChartExtent.GetBounds(AIndex: Integer): Double;
|
function TChartExtent.GetBounds(AIndex: Integer): Double;
|
||||||
begin
|
begin
|
||||||
Result := FExtent.coords[AIndex];
|
Result := FExtent.coords[AIndex];
|
||||||
|
Loading…
Reference in New Issue
Block a user