diff --git a/.gitattributes b/.gitattributes index 3b1cd6a3d0..b57006486b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1505,6 +1505,11 @@ components/tachart/demo/demo.lpr svneol=native#text/plain components/tachart/demo/unit1.lfm svneol=native#text/plain components/tachart/demo/unit1.lrs svneol=native#text/plain components/tachart/demo/unit1.pas svneol=native#text/plain +components/tachart/funcdemo/funcdemo.lpi svneol=native#text/plain +components/tachart/funcdemo/funcdemo.lpr svneol=native#text/plain +components/tachart/funcdemo/main.lfm svneol=native#text/plain +components/tachart/funcdemo/main.lrs svneol=native#text/plain +components/tachart/funcdemo/main.pas svneol=native#text/plain components/tachart/tachartlazaruspkg.lpk svneol=native#text/plain components/tachart/tachartlazaruspkg.pas svneol=native#text/plain components/tachart/tachartutils.pas svneol=native#text/plain diff --git a/components/tachart/funcdemo/funcdemo.lpi b/components/tachart/funcdemo/funcdemo.lpi new file mode 100644 index 0000000000..f28f739607 --- /dev/null +++ b/components/tachart/funcdemo/funcdemo.lpi @@ -0,0 +1,70 @@ + + + + + + + + + + + <Icon Value="0"/> + <UseXPManifest Value="True"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> + <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/> + </PublishOptions> + <RunParams> + <local> + <FormatVersion Value="1"/> + <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> + </local> + </RunParams> + <RequiredPackages Count="2"> + <Item1> + <PackageName Value="TAChartLazarusPkg"/> + <MinVersion Major="1" Valid="True"/> + </Item1> + <Item2> + <PackageName Value="LCL"/> + </Item2> + </RequiredPackages> + <Units Count="2"> + <Unit0> + <Filename Value="funcdemo.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="funcdemo"/> + </Unit0> + <Unit1> + <Filename Value="main.pas"/> + <ComponentName Value="Form1"/> + <IsPartOfProject Value="True"/> + <ResourceBaseClass Value="Form"/> + <UnitName Value="main"/> + </Unit1> + </Units> + </ProjectOptions> + <CompilerOptions> + <Version Value="8"/> + <PathDelim Value="\"/> + <SearchPaths> + <IncludeFiles Value="$(ProjOutDir)\"/> + </SearchPaths> + <Linking> + <Options> + <Win32> + <GraphicApplication Value="True"/> + </Win32> + </Options> + </Linking> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/components/tachart/funcdemo/funcdemo.lpr b/components/tachart/funcdemo/funcdemo.lpr new file mode 100644 index 0000000000..90c0c21f69 --- /dev/null +++ b/components/tachart/funcdemo/funcdemo.lpr @@ -0,0 +1,22 @@ +program funcdemo; + +{$mode objfpc}{$H+} + +uses + {$IFDEF UNIX}{$IFDEF UseCThreads} + cthreads, + {$ENDIF}{$ENDIF} + Interfaces, // this includes the LCL widgetset + Forms + { you can add units after this }, main, LResources, TAChartLazarusPkg; + +{$IFDEF WINDOWS}{$R funcdemo.rc}{$ENDIF} + +begin + Application.Title := 'TAChart function series demo'; + {$I funcdemo.lrs} + Application.Initialize; + Application.CreateForm(TForm1, Form1); + Application.Run; +end. + diff --git a/components/tachart/funcdemo/main.lfm b/components/tachart/funcdemo/main.lfm new file mode 100644 index 0000000000..c41746c69e --- /dev/null +++ b/components/tachart/funcdemo/main.lfm @@ -0,0 +1,53 @@ +object Form1: TForm1 + Left = 290 + Height = 362 + Top = 152 + Width = 461 + Caption = 'Form1' + ClientHeight = 362 + ClientWidth = 461 + OnCreate = FormCreate + LCLVersion = '0.9.27' + object Chart1: TChart + Height = 362 + Width = 461 + Legend.Alignment = laRight + Legend.Visible = True + Title.Alignment = taCenter + Title.Brush.Color = clBtnFace + Title.Font.Color = clBlue + Title.Text.Strings = ( + 'TAChart' + ) + Foot.Brush.Color = clBtnFace + Foot.Font.Color = clBlue + LeftAxis.Grid.Style = psDot + LeftAxis.Grid.Visible = True + LeftAxis.Title.Angle = 90 + BottomAxis.Grid.Style = psDot + BottomAxis.Grid.Visible = True + Frame.Visible = True + BackColor = clBtnFace + Align = alClient + Color = clBtnFace + ParentColor = False + object Chart1FuncSeries1: TFuncSeries + Extent.XMin = -6.28 + Extent.YMin = -1 + Extent.XMax = 6.28 + Extent.YMax = 1 + Pen.Color = clOlive + Pen.Width = 2 + Title = 'Sin(x)' + end + object Chart1XAxis: TLine + ShowInLegend = False + SeriesColor = clBlack + end + object Chart1YAxis: TLine + ShowInLegend = False + LineStyle = lsVertical + SeriesColor = clBlack + end + end +end diff --git a/components/tachart/funcdemo/main.lrs b/components/tachart/funcdemo/main.lrs new file mode 100644 index 0000000000..67db1d2656 --- /dev/null +++ b/components/tachart/funcdemo/main.lrs @@ -0,0 +1,22 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TForm1','FORMDATA',[ + 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'"'#1#6'Height'#3'j'#1#3'Top'#3#152#0#5'Wi' + +'dth'#3#205#1#7'Caption'#6#5'Form1'#12'ClientHeight'#3'j'#1#11'ClientWidth'#3 + +#205#1#8'OnCreate'#7#10'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#6'TChart'#6 + +'Chart1'#6'Height'#3'j'#1#5'Width'#3#205#1#16'Legend.Alignment'#7#7'laRight' + +#14'Legend.Visible'#9#15'Title.Alignment'#7#8'taCenter'#17'Title.Brush.Color' + +#7#9'clBtnFace'#16'Title.Font.Color'#7#6'clBlue'#18'Title.Text.Strings'#1#6#7 + +'TAChart'#0#16'Foot.Brush.Color'#7#9'clBtnFace'#15'Foot.Font.Color'#7#6'clBl' + +'ue'#19'LeftAxis.Grid.Style'#7#5'psDot'#21'LeftAxis.Grid.Visible'#9#20'LeftA' + +'xis.Title.Angle'#2'Z'#21'BottomAxis.Grid.Style'#7#5'psDot'#23'BottomAxis.Gr' + +'id.Visible'#9#13'Frame.Visible'#9#9'BackColor'#7#9'clBtnFace'#5'Align'#7#8 + +'alClient'#5'Color'#7#9'clBtnFace'#11'ParentColor'#8#0#11'TFuncSeries'#17'Ch' + +'art1FuncSeries1'#11'Extent.XMin'#5#0#248'(\'#143#194#245#200#1#192#11'Exten' + +'t.YMin'#5#0#0#0#0#0#0#0#128#255#191#11'Extent.XMax'#5#0#248'(\'#143#194#245 + +#200#1'@'#11'Extent.YMax'#5#0#0#0#0#0#0#0#128#255'?'#9'Pen.Color'#7#7'clOliv' + +'e'#9'Pen.Width'#2#2#5'Title'#6#6'Sin(x)'#0#0#5'TLine'#11'Chart1XAxis'#12'Sh' + +'owInLegend'#8#11'SeriesColor'#7#7'clBlack'#0#0#5'TLine'#11'Chart1YAxis'#12 + +'ShowInLegend'#8#9'LineStyle'#7#10'lsVertical'#11'SeriesColor'#7#7'clBlack'#0 + +#0#0#0 +]); diff --git a/components/tachart/funcdemo/main.pas b/components/tachart/funcdemo/main.pas new file mode 100644 index 0000000000..8efc2020a4 --- /dev/null +++ b/components/tachart/funcdemo/main.pas @@ -0,0 +1,45 @@ +unit main; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + TAGraph, TASeries; + +type + + { TForm1 } + + TForm1 = class(TForm) + Chart1: TChart; + Chart1FuncSeries1: TFuncSeries; + Chart1YAxis: TLine; + Chart1XAxis: TLine; + procedure Chart1FuncSeries1Calculate(const AX: Double; out AY: Double); + procedure FormCreate(Sender: TObject); + end; + +var + Form1: TForm1; + +implementation + +{ TForm1 } + +procedure TForm1.Chart1FuncSeries1Calculate(const AX: Double; out AY: Double); +begin + AY := Sin(AX); +end; + +procedure TForm1.FormCreate(Sender: TObject); +begin + Chart1FuncSeries1.OnCalculate := @Chart1FuncSeries1Calculate; +end; + +initialization + {$I main.lrs} + +end. +