TAChart: Add TCustomChartSource.IsSorted function

git-svn-id: trunk@25920 -
This commit is contained in:
ask 2010-06-05 14:34:02 +00:00
parent d6b37e7cb4
commit 1e84a4ad0a

View File

@ -62,6 +62,7 @@ type
class procedure CheckFormat(const AFormat: String); class procedure CheckFormat(const AFormat: String);
function Extent: TDoubleRect; virtual; function Extent: TDoubleRect; virtual;
function FormatItem(const AFormat: String; AIndex: Integer): String; function FormatItem(const AFormat: String; AIndex: Integer): String;
function IsSorted: Boolean; virtual;
procedure ValuesInRange( procedure ValuesInRange(
AMin, AMax: Double; const AFormat: String; AUseY: Boolean; AMin, AMax: Double; const AFormat: String; AUseY: Boolean;
out AValues: TDoubleDynArray; out ATexts: TStringDynArray); virtual; out AValues: TDoubleDynArray; out ATexts: TStringDynArray); virtual;
@ -100,6 +101,7 @@ type
procedure Clear; procedure Clear;
procedure CopyForm(ASource: TCustomChartSource); procedure CopyForm(ASource: TCustomChartSource);
procedure Delete(AIndex: Integer); inline; procedure Delete(AIndex: Integer); inline;
function IsSorted: Boolean; override;
function SetXValue(AIndex: Integer; AValue: Double): Integer; function SetXValue(AIndex: Integer; AValue: Double): Integer;
procedure SetYValue(AIndex: Integer; AValue: Double); procedure SetYValue(AIndex: Integer; AValue: Double);
procedure Sort; procedure Sort;
@ -153,6 +155,8 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
public
function IsSorted: Boolean; override;
published published
property PointsNumber: Integer property PointsNumber: Integer
read FPointsNumber write SetPointsNumber default 0; read FPointsNumber write SetPointsNumber default 0;
@ -325,6 +329,11 @@ begin
FValuesTotalIsValid := false; FValuesTotalIsValid := false;
end; end;
function TCustomChartSource.IsSorted: Boolean;
begin
Result := false;
end;
function TCustomChartSource.IsUpdating: Boolean; inline; function TCustomChartSource.IsUpdating: Boolean; inline;
begin begin
Result := FUpdateCount > 0; Result := FUpdateCount > 0;
@ -555,6 +564,11 @@ begin
Result := PChartDataItem(FData.Items[AIndex]); Result := PChartDataItem(FData.Items[AIndex]);
end; end;
function TListChartSource.IsSorted: Boolean;
begin
Result := Sorted;
end;
procedure TListChartSource.SetDataPoints(AValue: TStrings); procedure TListChartSource.SetDataPoints(AValue: TStrings);
begin begin
if FDataPoints = AValue then exit; if FDataPoints = AValue then exit;
@ -759,6 +773,11 @@ begin
Result := @FCurItem; Result := @FCurItem;
end; end;
function TRandomChartSource.IsSorted: Boolean;
begin
Result := not RandomX;
end;
procedure TRandomChartSource.SetPointsNumber(const AValue: Integer); procedure TRandomChartSource.SetPointsNumber(const AValue: Integer);
begin begin
if FPointsNumber = AValue then exit; if FPointsNumber = AValue then exit;