TAChart: Add TListChartSource.SetText and TChartSeries.SetText procedures

git-svn-id: trunk@38732 -
This commit is contained in:
ask 2012-09-18 11:48:15 +00:00
parent 2974002ed0
commit 5c77b8e843
2 changed files with 16 additions and 0 deletions

View File

@ -176,6 +176,7 @@ type
function GetYMin: Double; function GetYMin: Double;
function GetYValue(AIndex: Integer): Double; function GetYValue(AIndex: Integer): Double;
procedure SetColor(AIndex: Integer; AColor: TColor); procedure SetColor(AIndex: Integer; AColor: TColor);
procedure SetText(AIndex: Integer; AValue: String); inline;
procedure SetXValue(AIndex: Integer; AValue: Double); inline; procedure SetXValue(AIndex: Integer; AValue: Double); inline;
procedure SetYValue(AIndex: Integer; AValue: Double); inline; procedure SetYValue(AIndex: Integer; AValue: Double); inline;
public public
@ -854,6 +855,11 @@ begin
UpdateParentChart; UpdateParentChart;
end; end;
procedure TChartSeries.SetText(AIndex: Integer; AValue: String);
begin
ListSource.SetText(AIndex, AValue);
end;
procedure TChartSeries.SetXValue(AIndex: Integer; AValue: Double); inline; procedure TChartSeries.SetXValue(AIndex: Integer; AValue: Double); inline;
begin begin
ListSource.SetXValue(AIndex, AValue); ListSource.SetXValue(AIndex, AValue);

View File

@ -61,6 +61,7 @@ type
procedure CopyFrom(ASource: TCustomChartSource); procedure CopyFrom(ASource: TCustomChartSource);
procedure Delete(AIndex: Integer); procedure Delete(AIndex: Integer);
function IsSorted: Boolean; override; function IsSorted: Boolean; override;
procedure SetText(AIndex: Integer; AValue: String);
function SetXValue(AIndex: Integer; AValue: Double): Integer; function SetXValue(AIndex: Integer; AValue: Double): Integer;
procedure SetYList(AIndex: Integer; const AYList: array of Double); procedure SetYList(AIndex: Integer; const AYList: array of Double);
procedure SetYValue(AIndex: Integer; AValue: Double); procedure SetYValue(AIndex: Integer; AValue: Double);
@ -521,6 +522,15 @@ begin
end; end;
end; end;
procedure TListChartSource.SetText(AIndex: Integer; AValue: String);
begin
with Item[AIndex]^ do begin
if Text = AValue then exit;
Text := AValue;
end;
Notify;
end;
function TListChartSource.SetXValue(AIndex: Integer; AValue: Double): Integer; function TListChartSource.SetXValue(AIndex: Integer; AValue: Double): Integer;
var var
oldX: Double; oldX: Double;