Jumat, 25 Oktober 2013

Cara Membuat Chart Pie dengan Delphi

temen2 ingin membuat seperti ini?
di bawah ini adalah listing nya:
======================================
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Series, TeEngine, ExtCtrls, TeeProcs, Chart, DbChart;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    DBChart1: TDBChart;
    Series1: TPieSeries;
    procedure FormCreate(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
   n:integer;
implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
n:=5;
 with series1 do
 begin
 clear;
 add(10,'T 2009',clred);
 add(15,'T 2010',clblue);
 add(20,'T 2011',clgreen);
 add(25,'T 2012',clyellow);
 add(30,'T 2013',clskyblue);

   end;


end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
 series1.Rotate(5);
with dbchart1.view3Doptions do
begin
zoom:=zoom - n;
if (zoom<80) or (zoom>=100)then
n:=-n;
end;
end;

end.
=======================================