unit Unit1;

interface

uses
  Windows, ComCtrls,Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeeURL, TeeNavigator, TeeEdiGene, Grids, TeeChartGrid,
  TeePreviewPanel, TeeGalleryPanel, TeeEdit, StdCtrls, TeeLisB,
  TeeSeriesTextEd, TeeOpenGL, ExtCtrls, TeeProcs, TeeDraw3D, TeCanvas,
  TeePenDlg, TeEngine, TeeDBEdit, TeeDBCrossTab, DB, TeeData, SUIButton,
  SUIForm, TeeInspector, Chart, Series, TeeSmith;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Chart1: TChart;
    Button1: TButton;
    ChartEditorPanel1: TChartEditorPanel;
    Label1: TLabel;
    Label2: TLabel;
    ComboBox1: TComboBox;
    ComboBox2: TComboBox;
    ChartEditor1: TChartEditor;
    Series1: TBarSeries;
    Series2: TBarSeries;
    ChartEditorPanel2: TChartEditorPanel;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure ComboBox1Change(Sender: TObject);
    procedure ComboBox2Change(Sender: TObject);
    procedure Chart1ClickAxis(Sender: TCustomChart; Axis: TChartAxis;
      Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    procedure Chart1ClickLegend(Sender: TCustomChart; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}



procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(10);
Series2.FillSampleValues(10);
ChartEditorPanel2.Editor.Tree.Visible := true;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin  //µ÷ÓÃÍ¼±í±à¼­Æ÷
ChartEditor1.Execute;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
var
p:TTabPosition;
begin
case ComboBox1.ItemIndex of
0: p := tpTop;
1: p := tpBottom;
2: p := tpLeft;
3: p := tpRight;
end;
ChartEditorPanel1.Editor.TabGeneral.PageControl.TabPosition  := p;
end;

procedure TForm1.ComboBox2Change(Sender: TObject);
var
p:TTabStyle;
begin
case ComboBox2.ItemIndex of
0: p:= tsTabs;
1: p:= tsButtons;
2: p:= tsFlatButtons;
end;
ChartEditorPanel1.Editor.TabGeneral.PageControl.Style := p;
end;

procedure TForm1.Chart1ClickAxis(Sender: TCustomChart; Axis: TChartAxis;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin

ChartEditorPanel1.Editor.TabAxis.Show;
ChartEditorPanel1.Editor.TabAxis.PageControl.ActivePage.PageIndex;

end;

procedure TForm1.Chart1ClickLegend(Sender: TCustomChart;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ChartEditorPanel1.Editor.TabLegend.Show;
end;


end.
