mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-19 07:29:25 +02:00
TAChart: Fix TChartSeries.SetColor to notify all listeners and require ListSource. Add TListChartSource.SetColor
git-svn-id: trunk@38733 -
This commit is contained in:
parent
5c77b8e843
commit
1789905e3c
@ -175,7 +175,7 @@ type
|
||||
function GetYMax: Double;
|
||||
function GetYMin: Double;
|
||||
function GetYValue(AIndex: Integer): Double;
|
||||
procedure SetColor(AIndex: Integer; AColor: TColor);
|
||||
procedure SetColor(AIndex: Integer; AColor: TColor); inline;
|
||||
procedure SetText(AIndex: Integer; AValue: String); inline;
|
||||
procedure SetXValue(AIndex: Integer; AValue: Double); inline;
|
||||
procedure SetYValue(AIndex: Integer; AValue: Double); inline;
|
||||
@ -814,11 +814,7 @@ end;
|
||||
|
||||
procedure TChartSeries.SetColor(AIndex: Integer; AColor: TColor);
|
||||
begin
|
||||
with Source[AIndex]^ do begin
|
||||
if Color = AColor then exit;
|
||||
Color := AColor;
|
||||
UpdateParentChart;
|
||||
end;
|
||||
ListSource.SetColor(AIndex, AColor);
|
||||
end;
|
||||
|
||||
procedure TChartSeries.SetMarks(AValue: TChartMarks);
|
||||
|
@ -61,10 +61,13 @@ type
|
||||
procedure CopyFrom(ASource: TCustomChartSource);
|
||||
procedure Delete(AIndex: Integer);
|
||||
function IsSorted: Boolean; override;
|
||||
|
||||
procedure SetColor(AIndex: Integer; AColor: TChartColor);
|
||||
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);
|
||||
|
||||
procedure Sort;
|
||||
published
|
||||
property DataPoints: TStrings read FDataPoints write SetDataPoints;
|
||||
@ -500,6 +503,15 @@ begin
|
||||
SetLength(Result^.YList, Max(YCount - 1, 0));
|
||||
end;
|
||||
|
||||
procedure TListChartSource.SetColor(AIndex: Integer; AColor: TChartColor);
|
||||
begin
|
||||
with Item[AIndex]^ do begin
|
||||
if Color = AColor then exit;
|
||||
Color := AColor;
|
||||
end;
|
||||
Notify;
|
||||
end;
|
||||
|
||||
procedure TListChartSource.SetDataPoints(AValue: TStrings);
|
||||
begin
|
||||
if FDataPoints = AValue then exit;
|
||||
|
Loading…
Reference in New Issue
Block a user