TAChart: Allow assignment of TFuncSeries, TColorMapSeries, TIntervalList

git-svn-id: trunk@29320 -
This commit is contained in:
ask 2011-02-02 07:50:56 +00:00
parent e6d3ed279e
commit 636d7a10cb
2 changed files with 44 additions and 0 deletions

View File

@ -94,6 +94,7 @@ type
procedure SetEpsilon(AValue: Double);
procedure SetOnChange(AValue: TNotifyEvent);
public
procedure Assign(ASource: TIntervalList);
constructor Create;
public
procedure AddPoint(APoint: Double); inline;
@ -965,6 +966,12 @@ begin
Changed;
end;
procedure TIntervalList.Assign(ASource: TIntervalList);
begin
FEpsilon := ASource.FEpsilon;
FIntervals := Copy(ASource.FIntervals);
end;
procedure TIntervalList.Changed;
begin
if Assigned(FOnChange) then

View File

@ -44,6 +44,7 @@ type
procedure AfterAdd; override;
procedure GetBounds(var ABounds: TDoubleRect); override;
public
procedure Assign(ASource: TPersistent); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
@ -72,6 +73,7 @@ type
procedure GetLegendItems(AItems: TChartLegendItems); override;
public
procedure Assign(ASource: TPersistent); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -111,6 +113,7 @@ type
procedure GetLegendItems(AItems: TChartLegendItems); override;
public
procedure Assign(ASource: TPersistent); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -152,6 +155,14 @@ begin
FExtent.SetOwner(FChart);
end;
procedure TBasicFuncSeries.Assign(ASource: TPersistent);
begin
if ASource is TBasicFuncSeries then
with TBasicFuncSeries(ASource) do
Self.Extent := FExtent;
inherited Assign(ASource);
end;
constructor TBasicFuncSeries.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@ -183,6 +194,18 @@ end;
{ TFuncSeries }
procedure TFuncSeries.Assign(ASource: TPersistent);
begin
if ASource is TFuncSeries then
with TFuncSeries(ASource) do begin
Self.FDomainExclusions.Assign(FDomainExclusions);
Self.FOnCalculate := FOnCalculate;
Self.Pen := FPen;
Self.FStep := FStep;
end;
inherited Assign(ASource);
end;
constructor TFuncSeries.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@ -340,6 +363,20 @@ end;
{ TColorMapSeries }
procedure TColorMapSeries.Assign(ASource: TPersistent);
begin
if ASource is TColorMapSeries then
with TColorMapSeries(ASource) do begin
Self.Brush := FBrush;
Self.ColorSource := FColorSource;
Self.FInterpolate := FInterpolate;
Self.FOnCalculate := FOnCalculate;
Self.FStepX := FStepX;
Self.FStepY := FStepY;
end;
inherited Assign(ASource);
end;
function TColorMapSeries.ColorByValue(AValue: Double): TColor;
var
lb, ub: Integer;