From 27748dacc45241f3bc066ea0d1f2435e4757f039 Mon Sep 17 00:00:00 2001 From: wp Date: Sun, 19 Oct 2014 22:11:11 +0000 Subject: [PATCH] TAChart: Improved Delphi compatibility of TACustomSeries (issue #0023499). git-svn-id: trunk@46611 - --- components/tachart/tacustomseries.pas | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/components/tachart/tacustomseries.pas b/components/tachart/tacustomseries.pas index 28a47a2b17..5f611b1e86 100644 --- a/components/tachart/tacustomseries.pas +++ b/components/tachart/tacustomseries.pas @@ -204,6 +204,15 @@ type function ListSource: TListChartSource; property Source: TCustomChartSource read GetSource write SetSource stored IsSourceStored; + public + // for Delphi compatibility + function LastValueIndex: Integer; inline; + function MaxXValue: Double; + function MinXValue: Double; + function MaxYValue: Double; + function MinYValue: Double; + property XValue[AIndex: Integer]: Double read GetXValue write SetXValue; + property YValue[AIndex: Integer]: Double read GetYValue write SetYValue; published property Active default true; property Marks: TChartMarks read FMarks write SetMarks; @@ -672,6 +681,11 @@ begin Result := Source.Count; end; +function TChartSeries.LastValueIndex: Integer; +begin + Result := Source.Count - 1; +end; + constructor TChartSeries.Create(AOwner: TComponent); const BUILTIN_SOURCE_NAME = 'Builtin'; @@ -784,6 +798,11 @@ begin Result := Extent.b.X; end; +function TChartSeries.MaxXValue: Double; +begin + Result := Extent.b.X; +end; + function TChartSeries.GetXMaxVal: Double; begin if Count > 0 then @@ -797,6 +816,11 @@ begin Result := Extent.a.X; end; +function TChartSeries.MinXValue: Double; +begin + Result := Extent.a.X; +end; + function TChartSeries.GetXValue(AIndex: Integer): Double; begin Result := Source[AIndex]^.X; @@ -812,11 +836,21 @@ begin Result := Extent.b.Y; end; +function TChartSeries.MaxYValue: Double; +begin + Result := Extent.b.Y; +end; + function TChartSeries.GetYMin: Double; begin Result := Extent.a.Y; end; +function TChartSeries.MinYValue: Double; +begin + Result := Extent.a.Y; +end; + function TChartSeries.GetYValue(AIndex: Integer): Double; begin Result := Source[AIndex]^.Y;