TAChart: Update chart after change of axis interval parameters

git-svn-id: trunk@31859 -
This commit is contained in:
ask 2011-08-03 16:26:51 +00:00
parent e486d01537
commit 7195e84854
4 changed files with 12 additions and 2 deletions

View File

@ -556,6 +556,8 @@ begin
FValueMax := Math.Min(Max, FValueMax);
end;
d := MakeValuesInRangeParams(FValueMin, FValueMax);
FValueMin := GetTransform.AxisToGraph(FValueMin);
FValueMax := GetTransform.AxisToGraph(FValueMax);
end;
SetLength(FMarkValues, 0);
vis := TChartAxisList(Collection).OnVisitSources;

View File

@ -87,6 +87,7 @@ type
TCustomChartAxisMarks = class(TBasicChartAxisMarks)
strict private
FDefaultSource: TIntervalChartSource;
FDefaultListener: TListener;
FStripes: TChartStyles;
procedure SetStripes(AValue: TChartStyles);
strict protected
@ -524,13 +525,16 @@ end;
constructor TCustomChartAxisMarks.Create(AOwner: TCustomChart);
begin
inherited Create(AOwner);
FDefaultListener := TListener.Create(nil, @StyleChanged);
FDefaultSource := TIntervalChartSource.Create(AOwner);
FDefaultSource.Broadcaster.Subscribe(FDefaultListener);
FDistance := 1;
FLabelBrush.Style := bsClear;
end;
destructor TCustomChartAxisMarks.Destroy;
begin
FreeAndNil(FDefaultListener);
FreeAndNil(FDefaultSource);
inherited;
end;

View File

@ -637,7 +637,8 @@ end;
procedure TListener.Forget;
begin
FBroadcaster := nil;
FRef^ := nil;
if FRef <> nil then
FRef^ := nil;
end;
function TListener.GetIsListening: Boolean;

View File

@ -196,7 +196,10 @@ end;
procedure TChartAxisIntervalParams.Changed;
begin
// Empty.
with FOwner as TCustomChartSource do begin
BeginUpdate;
EndUpdate;
end;
end;
constructor TChartAxisIntervalParams.Create(AOwner: TPersistent);