TAChart: Minor cleanups:

Move ShowInLegend initialization into TCustomChartSeries.
  Add empty override for TUserDrawnSeries.GetLegendItems.

git-svn-id: trunk@21900 -
This commit is contained in:
ask 2009-09-27 15:24:39 +00:00
parent 73ae5dc715
commit 33343e7d67
3 changed files with 8 additions and 4 deletions

View File

@ -133,6 +133,7 @@ constructor TCustomChartSeries.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FActive := true;
FShowInLegend := true;
end;
procedure TCustomChartSeries.SetActive(AValue: Boolean);
@ -233,7 +234,6 @@ begin
FBuiltinSource.Name := 'Builtin';
FBuiltinSource.Subscribe(FListener);
FMarks := TChartMarks.Create(FChart);
FShowInLegend := true;
end;
function TChartSeries.DefaultFormattedMark(AIndex: integer): String;

View File

@ -83,7 +83,7 @@ type
procedure Draw(ACanvas: TCanvas); virtual; abstract;
function IsEmpty: Boolean; virtual; abstract;
property Active: Boolean read FActive write SetActive;
property Active: Boolean read FActive write SetActive default true;
property Depth: TChartDistance read FDepth write SetDepth default 0;
property ParentChart: TChart read FChart;
property SeriesColor: TColor

View File

@ -294,6 +294,7 @@ type
procedure SetOnDraw(AValue: TSeriesDrawEvent);
procedure SetOnUpdateBounds(AValue: TSeriesUpdateBoundsEvent);
protected
procedure GetLegendItems(AItems: TChartLegendItems); override;
procedure UpdateBounds(var ABounds: TDoubleRect); override;
public
procedure Draw(ACanvas: TCanvas); override;
@ -550,7 +551,6 @@ constructor TLine.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FActive := true;
FLineStyle := lsHorizontal;
FPen := TPen.Create;
FPen.OnChange := @StyleChanged;
@ -1075,7 +1075,6 @@ constructor TFuncSeries.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FExtent := TChartExtent.Create(FChart);
FShowInLegend := true;
FPen := TChartPen.Create;
FPen.OnChange := @StyleChanged;
FStep := 2;
@ -1191,6 +1190,11 @@ begin
FOnDraw(ACanvas, FChart.ClipRect);
end;
procedure TUserDrawnSeries.GetLegendItems(AItems: TChartLegendItems);
begin
Unused(AItems);
end;
function TUserDrawnSeries.IsEmpty: Boolean;
begin
Result := not Assigned(FOnDraw);