TAChart: Add sources of tutorial on logarithmic axis to folder tutorials/moores_law, update readme.txt

git-svn-id: trunk@39219 -
This commit is contained in:
wp 2012-11-01 12:18:08 +00:00
parent d0904e069a
commit 2999984266
6 changed files with 319 additions and 0 deletions

4
.gitattributes vendored
View File

@ -3120,6 +3120,10 @@ components/tachart/tutorials/mandelbrot/main.lfm svneol=native#text/plain
components/tachart/tutorials/mandelbrot/main.pas svneol=native#text/pascal
components/tachart/tutorials/mandelbrot/mandelbrot.lpi svneol=native#text/plain
components/tachart/tutorials/mandelbrot/mandelbrot.lpr svneol=native#text/pascal
components/tachart/tutorials/moores_law/main.lfm svneol=native#text/plain
components/tachart/tutorials/moores_law/main.pas svneol=native#text/pascal
components/tachart/tutorials/moores_law/moore.lpi svneol=native#text/plain
components/tachart/tutorials/moores_law/moore.lpr svneol=native#text/pascal
components/tachart/tutorials/readme.txt svneol=native#text/plain
components/tdbf/Makefile svneol=native#text/plain
components/tdbf/Makefile.compiled svneol=native#text/plain

View File

@ -0,0 +1,112 @@
object Form1: TForm1
Left = 244
Height = 356
Top = 193
Width = 552
Caption = 'Form1'
ClientHeight = 356
ClientWidth = 552
OnCreate = FormCreate
LCLVersion = '1.0.1.3'
object Chart1: TChart
Left = 0
Height = 356
Top = 0
Width = 552
AxisList = <
item
Grid.Color = clSilver
Marks.Format = '%0:.0n'
Marks.Source = ListChartSource2
Marks.Style = smsCustom
Minors = <
item
Grid.Visible = False
Intervals.Count = 9
Intervals.MinLength = 5
Intervals.Options = [aipUseCount]
end>
Title.LabelFont.Orientation = 900
Title.LabelFont.Style = [fsBold]
Title.Visible = True
Title.Caption = 'Number of transistors'
Transformations = ChartAxisTransformations1
end
item
Grid.Color = clSilver
Intervals.MaxLength = 60
Alignment = calBottom
Minors = <>
Title.LabelFont.Style = [fsBold]
Title.Visible = True
Title.Caption = 'Year of market introduction'
end>
BackColor = clWhite
Foot.Alignment = taLeftJustify
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Foot.Text.Strings = (
'Source:'
'http://www.intel.com/pressroom/kits/quickreffam.htm'
)
Foot.Visible = True
Margins.Left = 24
Margins.Right = 24
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Font.Style = [fsBold]
Title.Text.Strings = (
'Progress in Microelectronics'
)
Title.Visible = True
Align = alClient
ParentColor = False
object Chart1LineSeries1: TLineSeries
Marks.Format = '%2:s'
Marks.LinkPen.Color = clGray
Marks.Style = smsLabel
AxisIndexY = 0
LineType = ltNone
Pointer.Brush.Color = clRed
Pointer.Style = psCircle
ShowPoints = True
Source = ListChartSource1
end
object Chart1FitSeries1: TFitSeries
AxisIndexX = 1
AxisIndexY = 0
FitEquation = feExp
OnFitComplete = Chart1FitSeries1FitComplete
ParamCount = 2
Source = ListChartSource1
end
end
object ListChartSource1: TListChartSource
DataPoints.Strings = (
'1972|2300|?|4004'
'1974|6000|?|8080'
'1978|29000|?|8086'
'1982|134000|?|80286'
'1986|275000|?|80386'
'1989|1200000|?|80486'
'1993|3100000|?|Pentium'
'1997|7500000|?|Pentium II'
'2001|42000000|?|Xeon'
'2006|152000000|?|Core Duo'
'2009|731000000|?|Core i7'
)
left = 240
top = 40
end
object ChartAxisTransformations1: TChartAxisTransformations
left = 243
top = 96
object ChartAxisTransformations1LogarithmAxisTransform1: TLogarithmAxisTransform
Base = 10
end
end
object ListChartSource2: TListChartSource
left = 243
top = 176
end
end

View File

@ -0,0 +1,73 @@
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, TAGraph, TASeries, TASources, Forms, Controls,
Graphics, Dialogs, TACustomSource, TATransformations, TAFuncSeries;
type
{ TForm1 }
TForm1 = class(TForm)
Chart1: TChart;
Chart1FitSeries1: TFitSeries;
Chart1LineSeries1: TLineSeries;
ChartAxisTransformations1: TChartAxisTransformations;
ChartAxisTransformations1LogarithmAxisTransform1: TLogarithmAxisTransform;
ListChartSource1: TListChartSource;
ListChartSource2: TListChartSource;
procedure Chart1FitSeries1FitComplete(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
uses
Math;
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
const
MIN = 0;
MAX = 12;
var
i: Integer;
value: double;
begin
for i := MIN to MAX do begin
value := IntPower(10, i);
ListChartSource2.Add(value, value);
end;
end;
procedure TForm1.Chart1FitSeries1FitComplete(Sender: TObject);
begin
{
with Chart1FitSeries1 do
ShowMessage(Format(
'Fit result: a = %.9g, b = %.9g',
[Param[0], Param[1]]
));
}
Chart1.Title.Text.Add(Format(
'The number of transistors doubles every %.0f years',
[ln(2) / Chart1FitSeries1.Param[1]]
));
end;
end.

View File

@ -0,0 +1,97 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="moore"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
</General>
<i18n>
<EnableI18N LFM="False"/>
</i18n>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="TAChartLazarusPkg"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="moore.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="moore"/>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="main"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<CodeGeneration>
<SmartLinkUnit Value="True"/>
</CodeGeneration>
<Linking>
<Debugging>
<StripSymbols Value="True"/>
</Debugging>
<LinkSmart Value="True"/>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerMessages>
<UseMsgFile Value="True"/>
</CompilerMessages>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,20 @@
program moore;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, main, tachartlazaruspkg
{ you can add units after this };
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -13,6 +13,19 @@ topic:
- legend
- axis titles
--------------------------------------------------------------------------------
folder "moores_law"
--------------------------------------------------------------------------------
tutorial
http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_ListChartSource,_Logarithmic_Axis,_Fitting
topics
- enter data at design-time
- point series
- series marks
- logarithmic axis
- fitting
--------------------------------------------------------------------------------
folder "func_series"
--------------------------------------------------------------------------------