mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-29 13:09:23 +02:00
TAChart: Add rotated series demo
git-svn-id: trunk@24128 -
This commit is contained in:
parent
eceabf9db6
commit
2591422032
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -2108,6 +2108,10 @@ components/tachart/demo/legend/legenddemo.lpi svneol=native#text/plain
|
||||
components/tachart/demo/legend/legenddemo.lpr svneol=native#text/pascal
|
||||
components/tachart/demo/legend/main.lfm svneol=native#text/plain
|
||||
components/tachart/demo/legend/main.pas svneol=native#text/pascal
|
||||
components/tachart/demo/rotate/Main.lfm svneol=native#text/pascal
|
||||
components/tachart/demo/rotate/Main.pas svneol=native#text/pascal
|
||||
components/tachart/demo/rotate/rotatedemo.lpi svneol=native#text/plain
|
||||
components/tachart/demo/rotate/rotatedemo.lpr svneol=native#text/pascal
|
||||
components/tachart/demo/save/main.lfm svneol=native#text/plain
|
||||
components/tachart/demo/save/main.pas svneol=native#text/plain
|
||||
components/tachart/demo/save/savedemo.lpi svneol=native#text/plain
|
||||
|
104
components/tachart/demo/rotate/Main.lfm
Normal file
104
components/tachart/demo/rotate/Main.lfm
Normal file
@ -0,0 +1,104 @@
|
||||
object Form1: TForm1
|
||||
Left = 342
|
||||
Height = 372
|
||||
Top = 152
|
||||
Width = 456
|
||||
Caption = 'Form1'
|
||||
ClientHeight = 372
|
||||
ClientWidth = 456
|
||||
LCLVersion = '0.9.29'
|
||||
object Chart1: TChart
|
||||
Left = 0
|
||||
Height = 336
|
||||
Top = 0
|
||||
Width = 456
|
||||
AxisList = <
|
||||
item
|
||||
Alignment = calLeft
|
||||
Title.Font.Orientation = 900
|
||||
Transformation.Offset = 0
|
||||
Transformation.Scale = 1
|
||||
end
|
||||
item
|
||||
Alignment = calBottom
|
||||
Transformation.Offset = 0
|
||||
Transformation.Scale = 1
|
||||
end>
|
||||
Foot.Brush.Color = clBtnFace
|
||||
Foot.Font.Color = clBlue
|
||||
Title.Brush.Color = clBtnFace
|
||||
Title.Font.Color = clBlue
|
||||
Title.Text.Strings = (
|
||||
'TAChart'
|
||||
)
|
||||
Align = alClient
|
||||
ParentColor = False
|
||||
object Chart1LineSeries1: TLineSeries
|
||||
Marks.Format = '%1:.0g%%'
|
||||
Marks.Style = smsCustom
|
||||
ZPosition = 12
|
||||
AxisIndexX = 1
|
||||
AxisIndexY = 0
|
||||
LinePen.Color = clRed
|
||||
LinePen.Style = psDot
|
||||
LinePen.Width = 5
|
||||
SeriesColor = clRed
|
||||
Source = RandomChartSource1
|
||||
end
|
||||
object Chart1BarSeries1: TBarSeries
|
||||
ZPosition = 11
|
||||
AxisIndexX = 1
|
||||
AxisIndexY = 0
|
||||
BarBrush.Color = clMoneyGreen
|
||||
SeriesColor = clMoneyGreen
|
||||
Source = RandomChartSource1
|
||||
end
|
||||
end
|
||||
object Panel1: TPanel
|
||||
Left = 0
|
||||
Height = 36
|
||||
Top = 336
|
||||
Width = 456
|
||||
Align = alBottom
|
||||
ClientHeight = 36
|
||||
ClientWidth = 456
|
||||
TabOrder = 1
|
||||
object cbRotateLine: TCheckBox
|
||||
Left = 8
|
||||
Height = 17
|
||||
Top = 10
|
||||
Width = 77
|
||||
Caption = 'Rotate lines'
|
||||
OnChange = cbRotateLineChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object cbRotateBar: TCheckBox
|
||||
Left = 104
|
||||
Height = 17
|
||||
Top = 10
|
||||
Width = 77
|
||||
Caption = 'Rotate bars'
|
||||
OnChange = cbRotateBarChange
|
||||
TabOrder = 1
|
||||
end
|
||||
object cbNegative: TCheckBox
|
||||
Left = 200
|
||||
Height = 17
|
||||
Top = 10
|
||||
Width = 97
|
||||
Caption = 'Negative values'
|
||||
OnChange = cbNegativeChange
|
||||
TabOrder = 2
|
||||
end
|
||||
end
|
||||
object RandomChartSource1: TRandomChartSource
|
||||
PointsNumber = 9
|
||||
RandSeed = 1376070732
|
||||
XMax = 8
|
||||
XMin = 0
|
||||
YMax = 15
|
||||
YMin = 7
|
||||
left = 352
|
||||
top = 20
|
||||
end
|
||||
end
|
65
components/tachart/demo/rotate/Main.pas
Normal file
65
components/tachart/demo/rotate/Main.pas
Normal file
@ -0,0 +1,65 @@
|
||||
unit Main;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Classes, ExtCtrls, StdCtrls, SysUtils, FileUtil, LResources, Forms, Controls,
|
||||
Graphics, Dialogs, TAGraph, TASeries, TASources;
|
||||
|
||||
type
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
TForm1 = class(TForm)
|
||||
cbRotateBar: TCheckBox;
|
||||
cbNegative: TCheckBox;
|
||||
Chart1: TChart;
|
||||
Chart1BarSeries1: TBarSeries;
|
||||
Chart1LineSeries1: TLineSeries;
|
||||
cbRotateLine: TCheckBox;
|
||||
Panel1: TPanel;
|
||||
RandomChartSource1: TRandomChartSource;
|
||||
procedure cbNegativeChange(Sender: TObject);
|
||||
procedure cbRotateBarChange(Sender: TObject);
|
||||
procedure cbRotateLineChange(Sender: TObject);
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.lfm}
|
||||
|
||||
procedure Rotate(ASeries: TBasicPointSeries);
|
||||
var
|
||||
t: Integer;
|
||||
begin
|
||||
with ASeries do begin
|
||||
t := AxisIndexX;
|
||||
AxisIndexX := AxisIndexY;
|
||||
AxisIndexY := t;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TForm1 }
|
||||
|
||||
procedure TForm1.cbNegativeChange(Sender: TObject);
|
||||
begin
|
||||
RandomChartSource1.YMin := -RandomChartSource1.YMin;
|
||||
end;
|
||||
|
||||
procedure TForm1.cbRotateBarChange(Sender: TObject);
|
||||
begin
|
||||
Rotate(Chart1BarSeries1)
|
||||
end;
|
||||
|
||||
procedure TForm1.cbRotateLineChange(Sender: TObject);
|
||||
begin
|
||||
Rotate(Chart1LineSeries1)
|
||||
end;
|
||||
|
||||
end.
|
||||
|
97
components/tachart/demo/rotate/rotatedemo.lpi
Normal file
97
components/tachart/demo/rotate/rotatedemo.lpi
Normal file
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0"?>
|
||||
<CONFIG>
|
||||
<ProjectOptions>
|
||||
<PathDelim Value="\"/>
|
||||
<Version Value="7"/>
|
||||
<General>
|
||||
<Flags>
|
||||
<UseDefaultCompilerOptions Value="True"/>
|
||||
</Flags>
|
||||
<SessionStorage Value="InProjectDir"/>
|
||||
<MainUnit Value="0"/>
|
||||
<TargetFileExt Value=".exe"/>
|
||||
<Title Value="rotatedemo"/>
|
||||
<ResourceType Value="res"/>
|
||||
<UseXPManifest Value="True"/>
|
||||
</General>
|
||||
<VersionInfo>
|
||||
<Language Value=""/>
|
||||
<CharSet Value=""/>
|
||||
<StringTable Comments="" CompanyName="" FileDescription="" FileVersion="" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName="" ProductVersion=""/>
|
||||
</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="rotatedemo.lpr"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<UnitName Value="rotatedemo"/>
|
||||
</Unit0>
|
||||
<Unit1>
|
||||
<Filename Value="Main.pas"/>
|
||||
<IsPartOfProject Value="True"/>
|
||||
<ComponentName Value="Form1"/>
|
||||
<ResourceBaseClass Value="Form"/>
|
||||
<UnitName Value="Main"/>
|
||||
</Unit1>
|
||||
</Units>
|
||||
</ProjectOptions>
|
||||
<CompilerOptions>
|
||||
<Version Value="8"/>
|
||||
<PathDelim Value="\"/>
|
||||
<Target>
|
||||
<Filename Value="rotatedemo"/>
|
||||
</Target>
|
||||
<SearchPaths>
|
||||
<IncludeFiles Value="$(ProjOutDir)\"/>
|
||||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
|
||||
</SearchPaths>
|
||||
<Parsing>
|
||||
<SyntaxOptions>
|
||||
<UseAnsiStrings Value="True"/>
|
||||
</SyntaxOptions>
|
||||
</Parsing>
|
||||
<Linking>
|
||||
<Options>
|
||||
<Win32>
|
||||
<GraphicApplication Value="True"/>
|
||||
</Win32>
|
||||
</Options>
|
||||
</Linking>
|
||||
<Other>
|
||||
<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>
|
20
components/tachart/demo/rotate/rotatedemo.lpr
Normal file
20
components/tachart/demo/rotate/rotatedemo.lpr
Normal file
@ -0,0 +1,20 @@
|
||||
program rotatedemo;
|
||||
|
||||
{$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.
|
||||
|
Loading…
Reference in New Issue
Block a user