Delphi中TeeChart用法------饼图

测试代码如下:

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, TeEngine, ExtCtrls, TeeProcs, Chart, Series; type TForm1 = class(TForm) Chart1: TChart; procedure FormCreate(Sender: TObject); procedure Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Chart1ClickSeries(Sender: TCustomChart; Series: TChartSeries; ValueIndex: Integer; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ShowMessage(Series.XLabel[ValueIndex]); end; procedure TForm1.FormCreate(Sender: TObject); var series1 : TPieSeries; begin Series1 := TPieSeries.Create(Chart1); Series1.Clear; Series1.Add( 1, 'abc', clRed ); Series1.Add( 2, 'def', clYellow ); Series1.Add( 3, 'ghi', clGreen ); Chart1.AddSeries(series1); end; end.

你可能感兴趣的:(windows,Integer,Class,button,Delphi,Forms)