mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-01 14:12:37 +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;
|
||||
var
|
||||
i, j: Integer;
|
||||
x: Double;
|
||||
|
||||
function ExtraWidth(AIndex: Integer): Double;
|
||||
@ -288,13 +287,8 @@ var
|
||||
end;
|
||||
|
||||
begin
|
||||
Result := EmptyExtent;
|
||||
if Source.YCount < 5 then exit;
|
||||
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);
|
||||
if Source.YCount < 5 then exit(EmptyExtent);
|
||||
Result := Source.ExtentList;
|
||||
// Show first and last boxes fully.
|
||||
x := GetGraphPointX(0);
|
||||
Result.a.X := Min(Result.a.X, x - ExtraWidth(0));
|
||||
|
@ -67,7 +67,8 @@ type
|
||||
function IsUpdating: Boolean; inline;
|
||||
public
|
||||
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);
|
||||
function FormatItem(const AFormat: String; AIndex: Integer): String;
|
||||
function IsSorted: Boolean; virtual;
|
||||
@ -359,6 +360,17 @@ begin
|
||||
Result := FExtent;
|
||||
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(
|
||||
AXMin, AXMax: Double; out ALB, AUB: Integer);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user