diff --git a/components/tachart/demo/3d/main.lfm b/components/tachart/demo/3d/main.lfm index db48753141..d622c5ba49 100644 --- a/components/tachart/demo/3d/main.lfm +++ b/components/tachart/demo/3d/main.lfm @@ -8,7 +8,7 @@ object Form1: TForm1 ClientWidth = 560 OnShow = FormShow Position = poScreenCenter - LCLVersion = '0.9.29' + LCLVersion = '0.9.31' object Chart1: TChart Left = 0 Height = 297 @@ -16,10 +16,12 @@ object Form1: TForm1 Width = 560 AxisList = < item + Minors = <> Title.LabelFont.Orientation = 900 end item Alignment = calBottom + Minors = <> end> BackColor = clSilver Depth = 50 diff --git a/components/tachart/demo/3d/main.pas b/components/tachart/demo/3d/main.pas index df7df18ccc..bc2dbf063b 100644 --- a/components/tachart/demo/3d/main.pas +++ b/components/tachart/demo/3d/main.pas @@ -54,11 +54,11 @@ end; procedure TForm1.seDepthChange(Sender: TObject); var - i: Integer; + s: TBasicChartSeries; begin Chart1.Depth := seDepth.Value; - for i := 0 to Chart1.SeriesCount - 1 do - Chart1.Series[i].Depth := Min(seDepth.Value, 10); + for s in Chart1.Series do + s.Depth := Min(seDepth.Value, 10); end; end. diff --git a/components/tachart/demo/3d/zdemo.lpi b/components/tachart/demo/3d/zdemo.lpi index 38fe142d04..146471bae7 100644 --- a/components/tachart/demo/3d/zdemo.lpi +++ b/components/tachart/demo/3d/zdemo.lpi @@ -1,22 +1,23 @@ + - - - <ResourceType Value="res"/> </General> <VersionInfo> - <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/> + <StringTable ProductVersion=""/> </VersionInfo> + <BuildModes Count="1"> + <Item1 Name="default" Default="True"/> + </BuildModes> <PublishOptions> <Version Value="2"/> <IgnoreBinaries Value="False"/> @@ -54,10 +55,10 @@ </Units> </ProjectOptions> <CompilerOptions> - <Version Value="9"/> + <Version Value="10"/> <PathDelim Value="\"/> <SearchPaths> - <IncludeFiles Value="$(ProjOutDir)\"/> + <IncludeFiles Value="$(ProjOutDir)"/> <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> diff --git a/components/tachart/demo/basic/unit1.lfm b/components/tachart/demo/basic/unit1.lfm index 5e95ddfb05..6397a2441c 100644 --- a/components/tachart/demo/basic/unit1.lfm +++ b/components/tachart/demo/basic/unit1.lfm @@ -17,12 +17,14 @@ object Form1: TForm1 AxisList = < item Grid.Color = clGray + Minors = <> Title.LabelFont.Height = -11 Title.LabelFont.Name = 'MS Sans Serif' end item - Alignment = calBottom Grid.Color = clGray + Alignment = calBottom + Minors = <> Title.LabelFont.Height = -11 Title.LabelFont.Name = 'MS Sans Serif' end> diff --git a/components/tachart/demo/basic/unit1.pas b/components/tachart/demo/basic/unit1.pas index 862687b625..cb3e45e951 100644 --- a/components/tachart/demo/basic/unit1.pas +++ b/components/tachart/demo/basic/unit1.pas @@ -87,9 +87,10 @@ uses procedure TForm1.BringToFront(ASeries: TBasicChartSeries); var i: Integer; + s: TBasicChartSeries; begin - for i := 0 to Chart1.SeriesCount - 1 do - Chart1.Series[i].ZPosition := Ord(Chart1.Series[i] = ASeries); + for s in Chart1.Series do + s.ZPosition := Ord(s = ASeries); end; procedure TForm1.btnAddAreaClick(Sender: TObject); diff --git a/components/tachart/demo/line/Main.lfm b/components/tachart/demo/line/Main.lfm index c2af5fb93e..fcc379b2a5 100644 --- a/components/tachart/demo/line/Main.lfm +++ b/components/tachart/demo/line/Main.lfm @@ -29,10 +29,12 @@ object Form1: TForm1 Width = 637 AxisList = < item + Minors = <> Title.LabelFont.Orientation = 900 end item Alignment = calBottom + Minors = <> end> Foot.Brush.Color = clBtnFace Foot.Font.Color = clBlue @@ -159,10 +161,12 @@ object Form1: TForm1 Width = 637 AxisList = < item + Minors = <> Title.LabelFont.Orientation = 900 end item Alignment = calBottom + Minors = <> end> Foot.Brush.Color = clBtnFace Foot.Font.Color = clBlue @@ -210,10 +214,12 @@ object Form1: TForm1 Width = 467 AxisList = < item + Minors = <> Title.LabelFont.Orientation = 900 end item Alignment = calBottom + Minors = <> end> AxisVisible = False ExpandPercentage = 5 diff --git a/components/tachart/demo/line/Main.pas b/components/tachart/demo/line/Main.pas index dff07f2efe..783d0e2067 100644 --- a/components/tachart/demo/line/Main.pas +++ b/components/tachart/demo/line/Main.pas @@ -62,7 +62,11 @@ implementation {$R *.lfm} uses - LCLIntf, TATypes, TAChartUtils; + LCLIntf, TAChartUtils, TATypes, TAEnumerators; + +type + TLineSeriesEnum = + specialize TFilteredChartSeriesEnumeratorFactory<TLineSeries>; { TForm1 } @@ -95,45 +99,37 @@ end; procedure TForm1.cb3DChange(Sender: TObject); var - i: Integer; + ls: TLineSeries; begin - for i := 0 to chFast.SeriesCount - 1 do - if chFast.Series[i] is TLineSeries then - with chFast.Series[i] as TLineSeries do - Depth := 15 - Depth; + for ls in TLineSeriesEnum.Create(chFast) do + ls.Depth := 15 - ls.Depth; end; procedure TForm1.cbLineTypeChange(Sender: TObject); var - i: Integer; + ls: TLineSeries; begin - for i := 0 to chFast.SeriesCount - 1 do - if chFast.Series[i] is TLineSeries then - with chFast.Series[i] as TLineSeries do - LineType := TLineType(cbLineType.ItemIndex); + for ls in TLineSeriesEnum.Create(chFast) do + ls.LineType := TLineType(cbLineType.ItemIndex); end; procedure TForm1.cbRotatedChange(Sender: TObject); var - i: Integer; + ls: TLineSeries; begin - for i := 0 to chFast.SeriesCount - 1 do - if chFast.Series[i] is TLineSeries then - with chFast.Series[i] as TLineSeries do begin - AxisIndexY := Ord(cbRotated.Checked); - AxisIndexX := 1 - AxisIndexY; - end; + for ls in TLineSeriesEnum.Create(chFast) do begin + ls.AxisIndexY := Ord(cbRotated.Checked); + ls.AxisIndexX := 1 - ls.AxisIndexY; + end; end; procedure TForm1.cbSortedChange(Sender: TObject); var - i: Integer; + ls: TLineSeries; begin - for i := 0 to chFast.SeriesCount - 1 do - if chFast.Series[i] is TLineSeries then - with chFast.Series[i] as TLineSeries do - if Source is TListChartSource then - ListSource.Sorted := cbSorted.Checked; + for ls in TLineSeriesEnum.Create(chFast) do + if ls.Source is TListChartSource then + ls.ListSource.Sorted := cbSorted.Checked; end; procedure TForm1.FormCreate(Sender: TObject); @@ -142,7 +138,7 @@ var ls: TLineSeries; s: ShortString; begin - for st := Low(st) to High(st) do begin + for st in TSeriesPointerStyle do begin ls := TLineSeries.Create(Self); ls.LinePen.Color := clGreen; ls.ShowPoints := true; @@ -161,10 +157,10 @@ end; procedure TForm1.sePointerSizeChange(Sender: TObject); var - i: Integer; + ls: TLineSeries; begin - for i := 0 to chPointers.SeriesCount - 1 do - with (chPointers.Series[i] as TLineSeries).Pointer do begin + for ls in TLineSeriesEnum.Create(chPointers) do + with ls.Pointer do begin HorizSize := sePointerSize.Value; VertSize := sePointerSize.Value; end; diff --git a/components/tachart/taenumerators.pas b/components/tachart/taenumerators.pas index beb74d9ce9..99609e7e5b 100644 --- a/components/tachart/taenumerators.pas +++ b/components/tachart/taenumerators.pas @@ -30,7 +30,7 @@ type FChart: TChart; FFilter: TBooleanDynArray; public - constructor Create(AChart: TChart; AFilter: TBooleanDynArray); + constructor Create(AChart: TChart; AFilter: TBooleanDynArray = nil); property Chart: TChart read FChart; property Filter: TBooleanDynArray read FFilter; end;