mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-28 12:29:13 +02:00
TAChart: Update chart after change of axis interval parameters
git-svn-id: trunk@31859 -
This commit is contained in:
parent
e486d01537
commit
7195e84854
@ -556,6 +556,8 @@ begin
|
|||||||
FValueMax := Math.Min(Max, FValueMax);
|
FValueMax := Math.Min(Max, FValueMax);
|
||||||
end;
|
end;
|
||||||
d := MakeValuesInRangeParams(FValueMin, FValueMax);
|
d := MakeValuesInRangeParams(FValueMin, FValueMax);
|
||||||
|
FValueMin := GetTransform.AxisToGraph(FValueMin);
|
||||||
|
FValueMax := GetTransform.AxisToGraph(FValueMax);
|
||||||
end;
|
end;
|
||||||
SetLength(FMarkValues, 0);
|
SetLength(FMarkValues, 0);
|
||||||
vis := TChartAxisList(Collection).OnVisitSources;
|
vis := TChartAxisList(Collection).OnVisitSources;
|
||||||
|
@ -87,6 +87,7 @@ type
|
|||||||
TCustomChartAxisMarks = class(TBasicChartAxisMarks)
|
TCustomChartAxisMarks = class(TBasicChartAxisMarks)
|
||||||
strict private
|
strict private
|
||||||
FDefaultSource: TIntervalChartSource;
|
FDefaultSource: TIntervalChartSource;
|
||||||
|
FDefaultListener: TListener;
|
||||||
FStripes: TChartStyles;
|
FStripes: TChartStyles;
|
||||||
procedure SetStripes(AValue: TChartStyles);
|
procedure SetStripes(AValue: TChartStyles);
|
||||||
strict protected
|
strict protected
|
||||||
@ -524,13 +525,16 @@ end;
|
|||||||
constructor TCustomChartAxisMarks.Create(AOwner: TCustomChart);
|
constructor TCustomChartAxisMarks.Create(AOwner: TCustomChart);
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
|
FDefaultListener := TListener.Create(nil, @StyleChanged);
|
||||||
FDefaultSource := TIntervalChartSource.Create(AOwner);
|
FDefaultSource := TIntervalChartSource.Create(AOwner);
|
||||||
|
FDefaultSource.Broadcaster.Subscribe(FDefaultListener);
|
||||||
FDistance := 1;
|
FDistance := 1;
|
||||||
FLabelBrush.Style := bsClear;
|
FLabelBrush.Style := bsClear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TCustomChartAxisMarks.Destroy;
|
destructor TCustomChartAxisMarks.Destroy;
|
||||||
begin
|
begin
|
||||||
|
FreeAndNil(FDefaultListener);
|
||||||
FreeAndNil(FDefaultSource);
|
FreeAndNil(FDefaultSource);
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
@ -637,7 +637,8 @@ end;
|
|||||||
procedure TListener.Forget;
|
procedure TListener.Forget;
|
||||||
begin
|
begin
|
||||||
FBroadcaster := nil;
|
FBroadcaster := nil;
|
||||||
FRef^ := nil;
|
if FRef <> nil then
|
||||||
|
FRef^ := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TListener.GetIsListening: Boolean;
|
function TListener.GetIsListening: Boolean;
|
||||||
|
@ -196,7 +196,10 @@ end;
|
|||||||
|
|
||||||
procedure TChartAxisIntervalParams.Changed;
|
procedure TChartAxisIntervalParams.Changed;
|
||||||
begin
|
begin
|
||||||
// Empty.
|
with FOwner as TCustomChartSource do begin
|
||||||
|
BeginUpdate;
|
||||||
|
EndUpdate;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TChartAxisIntervalParams.Create(AOwner: TPersistent);
|
constructor TChartAxisIntervalParams.Create(AOwner: TPersistent);
|
||||||
|
Loading…
Reference in New Issue
Block a user