TAChart: Add radial series demo

git-svn-id: trunk@28549 -
This commit is contained in:
ask 2010-11-28 19:47:45 +00:00
parent 7fcd05e49f
commit e774fb0313
5 changed files with 250 additions and 0 deletions

4
.gitattributes vendored
View File

@ -2271,6 +2271,10 @@ components/tachart/demo/multi/Main.lfm svneol=native#text/plain
components/tachart/demo/multi/Main.pas svneol=native#text/pascal
components/tachart/demo/multi/multidemo.lpi svneol=native#text/plain
components/tachart/demo/multi/multidemo.lpr svneol=native#text/pascal
components/tachart/demo/radial/main.lfm svneol=native#text/plain
components/tachart/demo/radial/main.pas svneol=native#text/pascal
components/tachart/demo/radial/radialdemo.lpi svneol=native#text/plain
components/tachart/demo/radial/radialdemo.lpr 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

View File

@ -0,0 +1,85 @@
object Form1: TForm1
Left = 477
Height = 433
Top = 164
Width = 566
Caption = 'Form1'
ClientHeight = 433
ClientWidth = 566
Position = poScreenCenter
LCLVersion = '0.9.29'
object PageControl1: TPageControl
Left = 0
Height = 433
Top = 0
Width = 566
ActivePage = tsPie
Align = alClient
TabIndex = 0
TabOrder = 0
object tsPie: TTabSheet
Caption = 'Pie'
ClientHeight = 407
ClientWidth = 558
object ChartPie: TChart
Left = 0
Height = 372
Top = 35
Width = 558
AxisList = <
item
Title.LabelFont.Orientation = 900
Visible = False
end
item
Alignment = calBottom
Visible = False
end>
Foot.Brush.Color = clBtnFace
Foot.Font.Color = clBlue
Title.Brush.Color = clBtnFace
Title.Font.Color = clBlue
Title.Text.Strings = (
'TAChart'
)
Toolset = ChartToolset1
Align = alClient
ParentColor = False
OnMouseDown = ChartPieMouseDown
object ChartPiePieSeries1: TPieSeries
Exploded = True
Source = ListChartSource1
end
end
object Panel1: TPanel
Left = 0
Height = 35
Top = 0
Width = 558
Align = alTop
Caption = 'Click on the slice to explodede/unxeplode it'
TabOrder = 1
end
end
end
object ListChartSource1: TListChartSource
DataPoints.Strings = (
'0|1|?|'
'0|2|?|'
'0|3|?|'
'0|1|?|'
'0|2|?|'
'0|3|?|'
'0|1|?|'
'0|2|?|'
'0|3|?|'
'0|0|?|'
)
left = 440
top = 136
end
object ChartToolset1: TChartToolset
left = 440
top = 80
end
end

View File

@ -0,0 +1,48 @@
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, ComCtrls, ExtCtrls, SysUtils, FileUtil, Forms, Controls,
Graphics, Dialogs, TAGraph, TASeries, TASources, TATools;
type
{ TForm1 }
TForm1 = class(TForm)
ChartPie: TChart;
ChartPiePieSeries1: TPieSeries;
ChartToolset1: TChartToolset;
ListChartSource1: TListChartSource;
PageControl1: TPageControl;
Panel1: TPanel;
tsPie: TTabSheet;
procedure ChartPieMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.ChartPieMouseDown(
Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
i: Integer;
begin
i := ChartPiePieSeries1.FindContainingSlice(Point(X, Y));
if i < 0 then exit;
ListChartSource1.SetXValue(i, 0.2 - ListChartSource1[i]^.X);
ChartPie.Invalidate;
end;
end.

View File

@ -0,0 +1,93 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<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="3">
<Item1>
<PackageName Value="TAChartLazarusPkg"/>
<MinVersion Major="1" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LazControls"/>
<MinVersion Valid="True"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="radialdemo.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="radialdemo"/>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="main"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="9"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="radialdemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<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>

View File

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