TAChart: Move Title property from TBasicChartSeries to TCustomChartSeries

git-svn-id: trunk@32934 -
This commit is contained in:
ask 2011-10-17 07:57:08 +00:00
parent edc39d6747
commit 4447f89ee8
3 changed files with 13 additions and 13 deletions

View File

@ -51,6 +51,7 @@ type
FAxisIndexX: Integer;
FAxisIndexY: Integer;
FLegend: TChartSeriesLegend;
FTitle: String;
procedure SetAxisIndexX(AValue: Integer);
procedure SetAxisIndexY(AValue: Integer);
procedure SetLegend(AValue: TChartSeriesLegend);
@ -64,7 +65,7 @@ type
function GetShowInLegend: Boolean; override;
procedure SetActive(AValue: Boolean); override;
procedure SetDepth(AValue: TChartDistance); override;
procedure SetTitle(const AValue: String); override;
procedure SetTitle(AValue: String); virtual;
procedure SetZPosition(AValue: TChartDistance); override;
procedure StyleChanged(Sender: TObject);
procedure UpdateParentChart;
@ -89,7 +90,7 @@ type
function IsRotated: Boolean;
public
procedure Assign(Source: TPersistent); override;
procedure Assign(ASource: TPersistent); override;
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function GetNearestPoint(
@ -103,6 +104,7 @@ type
read FAxisIndexX write SetAxisIndexX default DEF_AXIS_INDEX;
property AxisIndexY: Integer
read FAxisIndexY write SetAxisIndexY default DEF_AXIS_INDEX;
property Title: String read FTitle write SetTitle;
published
property Legend: TChartSeriesLegend read FLegend write SetLegend;
@ -222,9 +224,9 @@ type
procedure DrawLabels(ADrawer: IChartDrawer);
procedure DrawPointers(ADrawer: IChartDrawer);
procedure GetLegendItemsRect(AItems: TChartLegendItems; ABrush: TBrush);
function NearestXNumber(var AIndex: Integer; ADir: Integer): Double;
function GetXRange(AX: Double; AIndex: Integer): Double;
function GetZeroLevel: Double; virtual;
function NearestXNumber(var AIndex: Integer; ADir: Integer): Double;
procedure PrepareGraphPoints(
const AExtent: TDoubleRect; AFilterByExtent: Boolean);
procedure UpdateMargins(ADrawer: IChartDrawer; var AMargins: TRect); override;
@ -257,15 +259,16 @@ begin
Legend.SetOwner(FChart);
end;
procedure TCustomChartSeries.Assign(Source: TPersistent);
procedure TCustomChartSeries.Assign(ASource: TPersistent);
begin
if Source is TCustomChartSeries then
with TCustomChartSeries(Source) do begin
if ASource is TCustomChartSeries then
with TCustomChartSeries(ASource) do begin
Self.FAxisIndexX := FAxisIndexX;
Self.FAxisIndexY := FAxisIndexY;
Self.Legend := FLegend;
Self.FTitle := FTitle;
end;
inherited Assign(Source);
inherited Assign(ASource);
end;
function TCustomChartSeries.AxisToGraph(
@ -478,7 +481,7 @@ begin
Legend.Visible := AValue;
end;
procedure TCustomChartSeries.SetTitle(const AValue: String);
procedure TCustomChartSeries.SetTitle(AValue: String);
begin
if FTitle = AValue then exit;
FTitle := AValue;

View File

@ -47,7 +47,6 @@ type
FActive: Boolean;
FChart: TChart;
FDepth: TChartDistance;
FTitle: String;
FZPosition: TChartDistance;
procedure AfterAdd; virtual; abstract;
@ -61,7 +60,6 @@ type
function GetShowInLegend: Boolean; virtual; abstract;
procedure SetActive(AValue: Boolean); virtual; abstract;
procedure SetDepth(AValue: TChartDistance); virtual; abstract;
procedure SetTitle(const AValue: String); virtual; abstract;
procedure SetZPosition(AValue: TChartDistance); virtual; abstract;
procedure UpdateMargins(ADrawer: IChartDrawer; var AMargins: TRect); virtual;
procedure VisitSources(
@ -85,7 +83,6 @@ type
property Active: Boolean read FActive write SetActive default true;
property Depth: TChartDistance read FDepth write SetDepth default 0;
property ParentChart: TChart read FChart;
property Title: String read FTitle write SetTitle;
property ZPosition: TChartDistance read FZPosition write SetZPosition default 0;
end;
@ -1506,7 +1503,6 @@ begin
with TBasicChartSeries(Source) do begin
Self.FActive := FActive;
Self.FDepth := FDepth;
Self.FTitle := FTitle;
Self.FZPosition := FZPosition;
end;
end;

View File

@ -1414,7 +1414,8 @@ procedure TDataPointHintTool.MouseMove(APoint: TPoint);
if Series is TChartSeries then
Result := (Series as TChartSeries).FormattedMark(PointIndex)
else
Result := Format('%s: %d', [Series.Title, PointIndex]);
Result := Format(
'%s: %d', [(Series as TCustomChartSeries).Title, PointIndex]);
end;
if Assigned(OnHint) then
OnHint(Self, APoint, Result);