mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 21:36:27 +02:00
TAChart: Extract TCustomChartSource.ExtentList function
git-svn-id: trunk@27131 -
This commit is contained in:
parent
823ef24846
commit
fe4ac38bf4
@ -279,7 +279,6 @@ end;
|
|||||||
|
|
||||||
function TBoxAndWhiskerSeries.Extent: TDoubleRect;
|
function TBoxAndWhiskerSeries.Extent: TDoubleRect;
|
||||||
var
|
var
|
||||||
i, j: Integer;
|
|
||||||
x: Double;
|
x: Double;
|
||||||
|
|
||||||
function ExtraWidth(AIndex: Integer): Double;
|
function ExtraWidth(AIndex: Integer): Double;
|
||||||
@ -288,13 +287,8 @@ var
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Result := EmptyExtent;
|
if Source.YCount < 5 then exit(EmptyExtent);
|
||||||
if Source.YCount < 5 then exit;
|
Result := Source.ExtentList;
|
||||||
Result := inherited Extent;
|
|
||||||
for i := 0 to Count - 1 do
|
|
||||||
with Source[i]^ do
|
|
||||||
for j := 0 to High(YList) do
|
|
||||||
UpdateMinMax(YList[j], Result.a.Y, Result.b.Y);
|
|
||||||
// Show first and last boxes fully.
|
// Show first and last boxes fully.
|
||||||
x := GetGraphPointX(0);
|
x := GetGraphPointX(0);
|
||||||
Result.a.X := Min(Result.a.X, x - ExtraWidth(0));
|
Result.a.X := Min(Result.a.X, x - ExtraWidth(0));
|
||||||
|
@ -67,7 +67,8 @@ type
|
|||||||
function IsUpdating: Boolean; inline;
|
function IsUpdating: Boolean; inline;
|
||||||
public
|
public
|
||||||
class procedure CheckFormat(const AFormat: String);
|
class procedure CheckFormat(const AFormat: String);
|
||||||
function Extent: TDoubleRect; virtual;
|
function Extent: TDoubleRect;
|
||||||
|
function ExtentList: TDoubleRect;
|
||||||
procedure FindBounds(AXMin, AXMax: Double; out ALB, AUB: Integer);
|
procedure FindBounds(AXMin, AXMax: Double; out ALB, AUB: Integer);
|
||||||
function FormatItem(const AFormat: String; AIndex: Integer): String;
|
function FormatItem(const AFormat: String; AIndex: Integer): String;
|
||||||
function IsSorted: Boolean; virtual;
|
function IsSorted: Boolean; virtual;
|
||||||
@ -359,6 +360,17 @@ begin
|
|||||||
Result := FExtent;
|
Result := FExtent;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomChartSource.ExtentList: TDoubleRect;
|
||||||
|
var
|
||||||
|
i, j: Integer;
|
||||||
|
begin
|
||||||
|
Result := Extent;
|
||||||
|
for i := 0 to Count - 1 do
|
||||||
|
with Item[i]^ do
|
||||||
|
for j := 0 to High(YList) do
|
||||||
|
UpdateMinMax(YList[j], Result.a.Y, Result.b.Y);
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TCustomChartSource.FindBounds(
|
procedure TCustomChartSource.FindBounds(
|
||||||
AXMin, AXMax: Double; out ALB, AUB: Integer);
|
AXMin, AXMax: Double; out ALB, AUB: Integer);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user