RingChart and AnalogWatch

From Lazarus wiki
Revision as of 00:24, 7 January 2006 by Salvatore (talk | contribs) (Download)

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

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.


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 licence (see the COPYING.LCL that come with this package or the COPYING.LCL that come with the Lazarus distro)

Download

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

Change Log

  • Version 0.1 2005/11/22


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
  • Click on Install

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: Just put it on a form and set colors as you want

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