Difference between revisions of "RingChart and AnalogWatch"

From Lazarus wiki
(Change Log)
m (Fixed syntax highlighting)
 
(18 intermediate revisions by 8 users not shown)
Line 1: Line 1:
==About==
+
{{RingChart and AnalogWatch}}
 +
 
 +
{{Warning|The chart components needed by this component have been removed from Lazarus in version 1.4. Since this time this page is outdated. }}
 +
<br />
 +
 
 +
== About ==
  
 
''TRingChart'' component is an elliptic Sectors Chart that we can consider a twin of the LCL TChart Component in the sense that has the same structure, particularly for the data input structure, but the rest is original.
 
''TRingChart'' component is an elliptic Sectors Chart that we can consider a twin of the LCL TChart Component in the sense that has the same structure, particularly for the data input structure, but the rest is original.
Line 18: Line 23:
 
You can personalize the watch with your fovourites colors.
 
You can personalize the watch with your fovourites colors.
 
An OnAppointment notify event has been added in the latest version that is triggered when the current time is equal to MeetTime (please read carefully the readme.txt file).
 
An OnAppointment notify event has been added in the latest version that is triggered when the current time is equal to MeetTime (please read carefully the readme.txt file).
The zip file contains a Lazarus Package that allows you to easy install the components (just compile and install). Furthermore there is a simple example that shows how to use the components.
+
From the version 0.3 (thanks to Seth Grover) the Watch has differents "mode":
 +
# "Clock" - the current default mode
 +
# "Stopwatch" - behaves like a stopwatch (you set the mode to stopwatch mode and then set StopwatchRunning to true or false to start/stop the stopwatch)
 +
# "Defined" mode - simply displays the time you tell it to display with the DefinedTime property.
 +
Furthermore there are some properties that hide/shows thinks like the tick marks, the digits on the clock face, and each hand individually .
 +
The zip file contains a Lazarus Package that allows you to easy install the components (just compile and install). Furthermore, there is a simple example that shows how to use the components.
  
These components have been tested on win32 and linux but it should be cross-platform.
+
These components have been tested on win32 and linux (gtk1) but it should be cross-platform.
  
==Screenshot==
+
== Screenshot ==
  
 
Here are how they appear.
 
Here are how they appear.
Line 33: Line 43:
 
[[Image:Ringandwatch.png]]
 
[[Image:Ringandwatch.png]]
  
==Author==
+
== Author ==
  
 
Salvatore Coppola
 
Salvatore Coppola
  
==License==
+
== License ==
  
 
modified LGPL same as Lazarus LCL license (see the COPYING.LGPL and the COPYING.modifiedLGPL that come with this package or the same files that come with the Lazarus distro)
 
modified LGPL same as Lazarus LCL license (see the COPYING.LGPL and the COPYING.modifiedLGPL that come with this package or the same files that come with the Lazarus distro)
  
==Download==
+
== Download ==
  
The latest stable release can be found on the  
+
The latest release can be found on the  
[http://sourceforge.net/project/showfiles.php?group_id=92177&package_id=181339 Lazarus CCR Files page]
+
[http://sourceforge.net/projects/lazarus-ccr/files/RingChart%20and%20AnalogWatch/ Lazarus CCR Files page]
  
==Change Log==
+
== Change Log ==
  
 
* Version 0.1 2005/11/22
 
* Version 0.1 2005/11/22
 
* Version 0.2 2006/02/26
 
* Version 0.2 2006/02/26
 +
* Version 0.3 2007/04/13
  
==Dependencies / System Requirements==
+
== Dependencies / System Requirements ==
  
 
* FCL and LCL that come with Lazarus
 
* FCL and LCL that come with Lazarus
Line 57: Line 68:
 
Status: Beta
 
Status: Beta
  
==Installation==
+
== Installation ==
  
 
* Unpack the zip file where you want, for instance  "mylazarus\mycomponents": you will find "mylazarus\mycomponents\ringwatch" that contain the files package and the example
 
* Unpack the zip file where you want, for instance  "mylazarus\mycomponents": you will find "mylazarus\mycomponents\ringwatch" that contain the files package and the example
 
* Open lazarus
 
* Open lazarus
 
* Open the package ringwatch.lpk with Component/Open package file (.lpk)
 
* Open the package ringwatch.lpk with Component/Open package file (.lpk)
* Click on Compile
+
* (Click on Compile only if you don't want to install the component into the IDE)
 
* Click on Install
 
* Click on Install
 +
* After installation the components will be available in the ''Misc'' tab of the IDE.
  
==Usage==
+
== Usage ==
  
 
After installed, you will find in 'Misc' tab of the Lazarus Compontens 2 new components:
 
After installed, you will find in 'Misc' tab of the Lazarus Compontens 2 new components:
Line 72: Line 84:
 
Drop the components on a form. Change some properties as you like and use this code to fill the Chart (how many sectors you want):
 
Drop the components on a form. Change some properties as you like and use this code to fill the Chart (how many sectors you want):
  
procedure TForm1.Button1Click(Sender: TObject);
+
<syntaxhighlight lang=pascal>
begin
+
procedure TForm1.Button1Click(Sender: TObject);
  RingChart1.Clear;
+
begin
  RingChart1.AddSector('Red',25.5,clRed);
+
  RingChart1.Clear;
  RingChart1.AddSector('Fuchsia',12.2,clFuchsia);
+
  RingChart1.AddSector('Red', 25.5, clRed);
  RingChart1.AddSector('Green',15,clGreen);
+
  RingChart1.AddSector('Fuchsia', 12.2, clFuchsia);
  RingChart1.AddSector('Yellow',4,clYellow);
+
  RingChart1.AddSector('Green', 15, clGreen);
  RingChart1.AddSector('Aqua',20,clAqua);
+
  RingChart1.AddSector('Yellow', 4, clYellow);
  RingChart1.AddSector('Cream',6.33,clCream);
+
  RingChart1.AddSector('Aqua', 20, clAqua);
end;
+
  RingChart1.AddSector('Cream', 6.33, clCream);
 +
end;</syntaxhighlight>
  
 
''AnalogWatch'':
 
''AnalogWatch'':
Just put it on a form and set colors as you want
+
Put it on a form
 +
Set colors as you want.
 +
If you assign the OnAppointment don't forget to set the MeetTime. You can use the MeetTime property Editor registered in the Lazarus IDE to easy assign his value or simply set it in the OI
  
==The ringchartwatch Example Application==
+
== The ringchartwatch Example Application ==
  
 
The ringchartwatch.lpi example is included in the example directory
 
The ringchartwatch.lpi example is included in the example directory
 
Install the ringwatch package Before to compile and run it with Lazarus and FPC
 
Install the ringwatch package Before to compile and run it with Lazarus and FPC
 +
 +
== See also ==
 +
 +
* [[TAChart]]
 +
 +
[[Category:Components]]
 +
[[Category:Charting]]
 +
[[Category:Lazarus-CCR]]

Latest revision as of 14:12, 25 February 2020

English (en)

Warning-icon.png

Warning: The chart components needed by this component have been removed from Lazarus in version 1.4. Since this time this page is outdated.


About

TRingChart component is an elliptic Sectors Chart that we can consider a twin of the LCL TChart Component in the sense that has the same structure, particularly for the data input structure, but the rest is original.

What's new?

  1. it is accurate in the sense that every sector surface is really proportionated to his pie percentage (TCanvas.RadialPie is similar but not exact for area) so if a green sector value is 17.27% of total values the green area is the 17.27% of the total ellipse area;
  2. it allows to include:
    • label (value and/or percentage)
    • legend (none, inside or outside)
  3. it manage value as double (not only integer)
  4. it allows:
    • change a single sector (Name or label, Value and color)
    • delete a single sector;
  5. it can appeares as a ring sectorized or a Pie (very rough)

TAnalogWatch is a graphic component that use a timer to show the current time in analog way. Just put it on a form. You can personalize the watch with your fovourites colors. An OnAppointment notify event has been added in the latest version that is triggered when the current time is equal to MeetTime (please read carefully the readme.txt file). From the version 0.3 (thanks to Seth Grover) the Watch has differents "mode":

  1. "Clock" - the current default mode
  2. "Stopwatch" - behaves like a stopwatch (you set the mode to stopwatch mode and then set StopwatchRunning to true or false to start/stop the stopwatch)
  3. "Defined" mode - simply displays the time you tell it to display with the DefinedTime property.

Furthermore there are some properties that hide/shows thinks like the tick marks, the digits on the clock face, and each hand individually . The zip file contains a Lazarus Package that allows you to easy install the components (just compile and install). Furthermore, there is a simple example that shows how to use the components.

These components have been tested on win32 and linux (gtk1) but it should be cross-platform.

Screenshot

Here are how they appear. RingChart is with these setting:

  • Legend:=lpOutSide;
  • KindOfLabel:=klBoth;
  • Ring:=true;

Ringandwatch.png

Author

Salvatore Coppola

License

modified LGPL same as Lazarus LCL license (see the COPYING.LGPL and the COPYING.modifiedLGPL that come with this package or the same files that come with the Lazarus distro)

Download

The latest release can be found on the Lazarus CCR Files page

Change Log

  • Version 0.1 2005/11/22
  • Version 0.2 2006/02/26
  • Version 0.3 2007/04/13

Dependencies / System Requirements

  • FCL and LCL that come with Lazarus

Status: Beta

Installation

  • Unpack the zip file where you want, for instance "mylazarus\mycomponents": you will find "mylazarus\mycomponents\ringwatch" that contain the files package and the example
  • Open lazarus
  • Open the package ringwatch.lpk with Component/Open package file (.lpk)
  • (Click on Compile only if you don't want to install the component into the IDE)
  • Click on Install
  • After installation the components will be available in the Misc tab of the IDE.

Usage

After installed, you will find in 'Misc' tab of the Lazarus Compontens 2 new components:

RingChart: Drop the components on a form. Change some properties as you like and use this code to fill the Chart (how many sectors you want):

procedure TForm1.Button1Click(Sender: TObject);
begin
  RingChart1.Clear;
  RingChart1.AddSector('Red', 25.5, clRed);
  RingChart1.AddSector('Fuchsia', 12.2, clFuchsia);
  RingChart1.AddSector('Green', 15, clGreen);
  RingChart1.AddSector('Yellow', 4, clYellow);
  RingChart1.AddSector('Aqua', 20, clAqua);
  RingChart1.AddSector('Cream', 6.33, clCream);
end;

AnalogWatch: Put it on a form Set colors as you want. If you assign the OnAppointment don't forget to set the MeetTime. You can use the MeetTime property Editor registered in the Lazarus IDE to easy assign his value or simply set it in the OI

The ringchartwatch Example Application

The ringchartwatch.lpi example is included in the example directory Install the ringwatch package Before to compile and run it with Lazarus and FPC

See also