unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, TeCanvas, ExtCtrls, Grids, TeeInspector, TeeProcs,
  TeEngine, Chart, Series, TeeEdit;

type
  TForm1 = class(TForm)
    Chart1: TChart;
    TeeInspector1: TTeeInspector;
    Panel1: TPanel;
    ComboFlat1: TComboFlat;
    Label1: TLabel;
    Button1: TButton;
    Series1: TBarSeries;
    ChartPreviewer1: TChartPreviewer;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure ComboFlat1Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure TeeInspector1Items0Change(Sender: TObject);
    procedure TeeInspector1Items1Change(Sender: TObject);
    procedure TeeInspector1Items2Change(Sender: TObject);
    procedure TeeInspector1Items3Change(Sender: TObject);
    procedure TeeInspector1Items4Change(Sender: TObject);
    procedure TeeInspector1Items6Change(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure TeeInspector1Items5Change(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Close;
end;

procedure TForm1.ComboFlat1Change(Sender: TObject);
begin
Series1.Clear;
case ComboFlat1.ItemIndex of
0: Series1.AddXY(1,300,'苹果');
1: Series1.AddXY(1,280,'桔子');
2: Series1.AddXY(1,450,'梨子');
3: Series1.AddXY(1,340,'葡萄');
4: Series1.AddXY(1,780,'甘蔗');
5: Series1.AddXY(1,890,'西瓜');
6: Series1.AddXY(1,600,'柿子');
end;
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
Series1.AddXY(1,300,'苹果');
end;

procedure TForm1.TeeInspector1Items0Change(Sender: TObject);
begin         //3d
  Chart1.View3D :=  TeeInspector1.Items[0].Value;
end;

procedure TForm1.TeeInspector1Items1Change(Sender: TObject);
begin        //标签
  Series1.Marks.Visible := TeeInspector1.Items[1].Value;
end;

procedure TForm1.TeeInspector1Items2Change(Sender: TObject);
begin        //图例
Chart1.Legend.Visible := TeeInspector1.Items[2].Value;
end;

procedure TForm1.TeeInspector1Items3Change(Sender: TObject);
begin //横坐标
Chart1.BottomAxis.Title.Caption := TeeInspector1.Items[3].Value;
end;

procedure TForm1.TeeInspector1Items4Change(Sender: TObject);
begin     //纵坐标
Chart1.LeftAxis.Title.Caption := TeeInspector1.Items[4].Value;
end;

procedure TForm1.TeeInspector1Items6Change(Sender: TObject);
begin  //图表标题
Chart1.Title.Text.Text := TeeInspector1.Items[6].Value;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
ChartPreviewer1.Execute;
end;

procedure TForm1.TeeInspector1Items5Change(Sender: TObject);
begin
Chart1.Title.Font.Color := TeeInspector1.Items[5].Value;
Chart1.BottomAxis.Title.Font.Color := TeeInspector1.Items[5].Value;
Chart1.LeftAxis.Title.Font.Color   := TeeInspector1.Items[5].Value;
Chart1.Refresh;
end;

end.
