TAChart: Extract TCustomChartSource.ExtentList function

git-svn-id: trunk@27131 -
This commit is contained in:
ask 2010-08-18 06:18:11 +00:00
parent 823ef24846
commit fe4ac38bf4
2 changed files with 15 additions and 9 deletions

View File

@ -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));

View File

@ -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);