mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:59:08 +02:00
TAChart: Convert TBasicChartSeries.GetGraphBounds to a public function
git-svn-id: trunk@38477 -
This commit is contained in:
parent
995b5a3d55
commit
8e2e2f20a6
@ -59,7 +59,6 @@ type
|
||||
|
||||
protected
|
||||
procedure AfterAdd; override;
|
||||
procedure GetGraphBounds(var ABounds: TDoubleRect); override;
|
||||
procedure GetLegendItems(AItems: TChartLegendItems); virtual; abstract;
|
||||
procedure GetLegendItemsBasic(AItems: TChartLegendItems); override;
|
||||
function GetShowInLegend: Boolean; override;
|
||||
@ -88,6 +87,7 @@ type
|
||||
function AxisToGraphY(AY: Double): Double; override;
|
||||
function GetAxisX: TChartAxis;
|
||||
function GetAxisY: TChartAxis;
|
||||
function GetGraphBounds: TDoubleRect; override;
|
||||
function GraphToAxis(APoint: TDoublePoint): TDoublePoint;
|
||||
function GraphToAxisX(AX: Double): Double; override;
|
||||
function GraphToAxisY(AY: Double): Double; override;
|
||||
@ -339,10 +339,11 @@ begin
|
||||
Result := FChart.LeftAxis;
|
||||
end;
|
||||
|
||||
procedure TCustomChartSeries.GetGraphBounds(var ABounds: TDoubleRect);
|
||||
function TCustomChartSeries.GetGraphBounds: TDoubleRect;
|
||||
begin
|
||||
GetBounds(ABounds);
|
||||
with ABounds do begin
|
||||
Result := EmptyExtent;
|
||||
GetBounds(Result);
|
||||
with Result do begin
|
||||
UpdateBoundsByAxisRange(FChart.AxisList, AxisIndexX, a.X, b.X);
|
||||
UpdateBoundsByAxisRange(FChart.AxisList, AxisIndexY, a.Y, b.Y);
|
||||
TransformByAxis(FChart.AxisList, AxisIndexX).UpdateBounds(a.X, b.X);
|
||||
|
@ -56,7 +56,6 @@ type
|
||||
// Set series bounds in axis coordinates.
|
||||
// Some or all bounds may be left unset, in which case they will be ignored.
|
||||
procedure GetBounds(var ABounds: TDoubleRect); virtual; abstract;
|
||||
procedure GetGraphBounds(var ABounds: TDoubleRect); virtual; abstract;
|
||||
procedure GetLegendItemsBasic(AItems: TChartLegendItems); virtual; abstract;
|
||||
function GetShowInLegend: Boolean; virtual; abstract;
|
||||
procedure SetActive(AValue: Boolean); virtual; abstract;
|
||||
@ -79,6 +78,7 @@ type
|
||||
|
||||
public
|
||||
procedure Draw(ADrawer: IChartDrawer); virtual; abstract;
|
||||
function GetGraphBounds: TDoubleRect; virtual; abstract;
|
||||
function IsEmpty: Boolean; virtual; abstract;
|
||||
procedure MovePoint(var AIndex: Integer; const ANewPos: TPoint); virtual;
|
||||
|
||||
@ -947,7 +947,7 @@ function TChart.GetFullExtent: TDoubleRect;
|
||||
end;
|
||||
|
||||
var
|
||||
seriesBounds, axisBounds: TDoubleRect;
|
||||
axisBounds: TDoubleRect;
|
||||
s: TBasicChartSeries;
|
||||
a: TChartAxis;
|
||||
begin
|
||||
@ -960,14 +960,12 @@ begin
|
||||
Result := EmptyExtent;
|
||||
for s in Series do begin
|
||||
if not s.Active then continue;
|
||||
seriesBounds := EmptyExtent;
|
||||
try
|
||||
s.GetGraphBounds(seriesBounds);
|
||||
JoinBounds(s.GetGraphBounds);
|
||||
except
|
||||
s.Active := false;
|
||||
raise;
|
||||
end;
|
||||
JoinBounds(seriesBounds);
|
||||
end;
|
||||
for a in AxisList do begin
|
||||
axisBounds := EmptyExtent;
|
||||
|
Loading…
Reference in New Issue
Block a user