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 GetYValue(AIndex: Integer): Double;
procedure SetColor(AIndex: Integer; AColor: TColor);
procedure SetText(AIndex: Integer; AValue: String); inline;
procedure SetXValue(AIndex: Integer; AValue: Double); inline;
procedure SetYValue(AIndex: Integer; AValue: Double); inline;
public
@ -854,6 +855,11 @@ begin
UpdateParentChart;
end;
procedure TChartSeries.SetText(AIndex: Integer; AValue: String);
begin
ListSource.SetText(AIndex, AValue);
end;
procedure TChartSeries.SetXValue(AIndex: Integer; AValue: Double); inline;
begin
ListSource.SetXValue(AIndex, AValue);

View File

@ -61,6 +61,7 @@ type
procedure CopyFrom(ASource: TCustomChartSource);
procedure Delete(AIndex: Integer);
function IsSorted: Boolean; override;
procedure SetText(AIndex: Integer; AValue: String);
function SetXValue(AIndex: Integer; AValue: Double): Integer;
procedure SetYList(AIndex: Integer; const AYList: array of Double);
procedure SetYValue(AIndex: Integer; AValue: Double);
@ -521,6 +522,15 @@ begin
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;
var
oldX: Double;