TAChart: Add TChartAxisMarks.Range property

git-svn-id: trunk@31824 -
This commit is contained in:
ask 2011-07-30 08:08:54 +00:00
parent b8bef2f439
commit 11d4e269aa
2 changed files with 18 additions and 0 deletions

View File

@ -545,6 +545,12 @@ begin
AMin := GetTransform.GraphToAxis(AMin);
AMax := GetTransform.GraphToAxis(AMax);
EnsureOrder(AMin, AMax);
with Marks.Range do begin
if UseMin then
AMin := Math.Max(Min, AMin);
if UseMax then
AMax := Math.Min(Max, AMax);
end;
SetLength(FMarkValues, 0);
vis := TChartAxisList(Collection).OnVisitSources;
if Marks.AtDataOnly and Assigned(vis) then begin

View File

@ -121,9 +121,11 @@ type
FAtDataOnly: Boolean;
FDefaultSource: TCustomChartSource;
FListener: TListener;
FRange: TChartRange;
FSource: TCustomChartSource;
procedure SetAtDataOnly(AValue: Boolean);
procedure SetRange(AValue: TChartRange);
procedure SetSource(AValue: TCustomChartSource);
public
constructor Create(AOwner: TCustomChart);
@ -138,6 +140,7 @@ type
property Frame;
property LabelBrush;
property OverlapPolicy;
property Range: TChartRange read FRange write SetRange;
property Source: TCustomChartSource read FSource write SetSource;
property Stripes;
property Style default smsValue;
@ -553,12 +556,14 @@ begin
inherited Create(AOwner);
FDefaultSource := TIntervalChartSource.Create(AOwner);
FListener := TListener.Create(@FSource, @StyleChanged);
FRange := TChartRange.Create(AOwner);
FStyle := smsValue;
FFormat := SERIES_MARK_FORMATS[FStyle];
end;
destructor TChartAxisMarks.Destroy;
begin
FreeAndNil(FRange);
FreeAndNil(FListener);
FreeAndNil(FDefaultSource);
inherited;
@ -571,6 +576,13 @@ begin
StyleChanged(Self);
end;
procedure TChartAxisMarks.SetRange(AValue: TChartRange);
begin
if FRange = AValue then exit;
FRange.Assign(AValue);
StyleChanged(Self);
end;
procedure TChartAxisMarks.SetSource(AValue: TCustomChartSource);
begin
if FSource = AValue then exit;