📄 main.~pas
字号:
unit main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, TeEngine, Series, Grids, DBGrids, DB,
TeeProcs, Chart, DbChart, DBTables, TeeFunci;
type
TForm1 = class(TForm)
Table1: TTable;
DBChart1: TDBChart;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
Series1: TBarSeries;
GroupBox1: TGroupBox;
Label1: TLabel;
edtTitle: TEdit;
btnSetTitle: TButton;
FontDialog1: TFontDialog;
btnTitleFont: TButton;
GroupBox2: TGroupBox;
cbx3D: TCheckBox;
cbxEachColor: TCheckBox;
GroupBox3: TGroupBox;
cbxLegend: TCheckBox;
btnColor: TButton;
ColorDialog1: TColorDialog;
Series4: TLineSeries;
Series5: TLineSeries;
TeeFunction3: TLowTeeFunction;
Series6: TLineSeries;
TeeFunction4: TAverageTeeFunction;
Series2: TLineSeries;
TeeFunction1: TAddTeeFunction;
procedure cbxLegendClick(Sender: TObject);
procedure cbxEachColorClick(Sender: TObject);
procedure cbx3DClick(Sender: TObject);
procedure btnColorClick(Sender: TObject);
procedure btnTitleFontClick(Sender: TObject);
procedure btnSetTitleClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.cbxLegendClick(Sender: TObject);
begin
//设置是否显示图例
DBChart1.Legend.Visible := cbxLegend.Checked ;
end;
procedure TForm1.cbxEachColorClick(Sender: TObject);
begin
//设置是否显示不同颜色
DBChart1.Series[0].ColorEachPoint := cbxEachColor.Checked ;
end;
procedure TForm1.cbx3DClick(Sender: TObject);
begin
//设置是否3D效果显示
DBChart1.View3D := cbx3D.Checked ;
end;
procedure TForm1.btnColorClick(Sender: TObject);
begin
//设置图例颜色
ColorDialog1.Color := DBChart1.Legend.Color;
if ColorDialog1.Execute then
DBChart1.Legend.Color := ColorDialog1.Color ;
end;
procedure TForm1.btnTitleFontClick(Sender: TObject);
begin
//设置标题字体
FontDialog1.Font.Assign(DBChart1.Title.Font);
if FontDialog1.Execute then
DBChart1.Title.Font.Assign(FontDialog1.Font);
end;
procedure TForm1.btnSetTitleClick(Sender: TObject);
begin
//设置标题
DBChart1.Title.Text.Text := edtTitle.Text ;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -