mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 23:16:04 +02:00
TAChart: Fix chart invalidation after changing subcomponents' properties
git-svn-id: trunk@27563 -
This commit is contained in:
parent
0b18b44d8e
commit
d589d25f96
@ -43,6 +43,7 @@ type
|
||||
procedure SetShowInLegend(AValue: Boolean);
|
||||
|
||||
protected
|
||||
procedure AfterAdd; override;
|
||||
procedure GetGraphBounds(var ABounds: TDoubleRect); override;
|
||||
procedure GetLegendItems(AItems: TChartLegendItems); virtual; abstract;
|
||||
procedure GetLegendItemsBasic(AItems: TChartLegendItems); override;
|
||||
@ -206,6 +207,11 @@ uses
|
||||
|
||||
{ TCustomChartSeries }
|
||||
|
||||
procedure TCustomChartSeries.AfterAdd;
|
||||
begin
|
||||
Legend.SetOwner(FChart);
|
||||
end;
|
||||
|
||||
function TCustomChartSeries.AxisToGraph(
|
||||
const APoint: TDoublePoint): TDoublePoint;
|
||||
begin
|
||||
@ -408,6 +414,7 @@ end;
|
||||
|
||||
procedure TChartSeries.AfterAdd;
|
||||
begin
|
||||
inherited;
|
||||
FMarks.SetOwner(FChart);
|
||||
end;
|
||||
|
||||
|
@ -51,7 +51,7 @@ type
|
||||
FTitle: String;
|
||||
FZPosition: TChartDistance;
|
||||
|
||||
procedure AfterAdd; virtual;
|
||||
procedure AfterAdd; virtual; abstract;
|
||||
procedure AfterDraw; virtual;
|
||||
procedure BeforeDraw; virtual;
|
||||
// Set series bounds in axis coordinates.
|
||||
@ -711,6 +711,9 @@ end;
|
||||
|
||||
procedure TChart.AddSeries(ASeries: TBasicChartSeries);
|
||||
begin
|
||||
if ASeries.FChart = Self then exit;
|
||||
if ASeries.FChart <> nil then
|
||||
ASeries.FChart.DeleteSeries(ASeries);
|
||||
DrawReticule(Canvas);
|
||||
Series.FList.Add(ASeries);
|
||||
ASeries.FChart := Self;
|
||||
@ -1094,11 +1097,6 @@ end;
|
||||
|
||||
{ TBasicChartSeries }
|
||||
|
||||
procedure TBasicChartSeries.AfterAdd;
|
||||
begin
|
||||
// nothing
|
||||
end;
|
||||
|
||||
procedure TBasicChartSeries.AfterDraw;
|
||||
begin
|
||||
// empty
|
||||
|
@ -858,6 +858,7 @@ end;
|
||||
|
||||
procedure TPieSeries.AfterAdd;
|
||||
begin
|
||||
inherited;
|
||||
// disable axis when we have TPie series
|
||||
ParentChart.LeftAxis.Visible := false;
|
||||
ParentChart.BottomAxis.Visible := false;
|
||||
|
@ -318,9 +318,12 @@ end;
|
||||
|
||||
procedure TChartElement.Assign(Source: TPersistent);
|
||||
begin
|
||||
//inherited Assign(Source);
|
||||
if Source is TChartElement then
|
||||
Self.FVisible := TChartElement(Source).FVisible;
|
||||
with TChartElement(Source) do begin
|
||||
Self.FVisible := FVisible;
|
||||
Self.FOwner := FOwner;
|
||||
end;
|
||||
inherited Assign(Source);
|
||||
end;
|
||||
|
||||
constructor TChartElement.Create(AOwner: TCustomChart);
|
||||
@ -427,7 +430,6 @@ end;
|
||||
|
||||
procedure TGenericChartMarks.Assign(Source: TPersistent);
|
||||
begin
|
||||
inherited Assign(Source);
|
||||
if Source is Self.ClassType then
|
||||
with TGenericChartMarks(Source) do begin
|
||||
Self.FClipped := FClipped;
|
||||
@ -440,6 +442,7 @@ begin
|
||||
Self.FOverlapPolicy := FOverlapPolicy;
|
||||
Self.FStyle := FStyle;
|
||||
end;
|
||||
inherited Assign(Source);
|
||||
end;
|
||||
|
||||
function TGenericChartMarks.CenterOffset(
|
||||
|
Loading…
Reference in New Issue
Block a user