📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, Grids, TeEngine, Series, ExtCtrls, TeeProcs,
Chart;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TBarSeries;
Series2: TBarSeries;
Series3: TBarSeries;
Series4: TBarSeries;
StringGrid1: TStringGrid;
ChBoxMarks: TCheckBox;
UpdateButton: TBitBtn;
procedure UpdateButtonClick(Sender: TObject);
procedure ChBoxMarksClick(Sender: TObject);
procedure StringGrid1GetEditMask(Sender: TObject; ACol, ARow: Integer;
var Value: String);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.UpdateButtonClick(Sender: TObject);
var
I, J: Integer;
begin
for I := 1 to 4 do
begin
Chart1.Series [I-1].Clear;
for J := 1 to 5 do
Chart1.Series [I-1].Add (
StrToInt (StringGrid1.Cells [J, I]),
'', Chart1.Series [I-1].SeriesColor);
end;
end;
procedure TForm1.ChBoxMarksClick(Sender: TObject);
var
I: Integer;
begin
for I := 1 to 4 do
Chart1.Series [I-1].Marks.Visible :=
ChBoxMarks.Checked;
end;
procedure TForm1.StringGrid1GetEditMask(Sender: TObject; ACol,
ARow: Integer; var Value: String);
begin
Value := '09;0';
end;
procedure TForm1.FormCreate(Sender: TObject);
var
I, J: Integer;
begin
chboxmarks.Checked :=ture;
with StringGrid1 do
begin
for I := 1 to 5 do
Cells [I, 0] := Format ('Group%d', [I]);
for J := 1 to 4 do
begin
Cells [0, J] := Format ('Series%d', [J]);
Chart1.Series [J-1].Title := Format ('Series%d', [J]);
end;
Randomize;
for I := 1 to 5 do
for J := 1 to 4 do
Cells [I, J] := IntToStr (Random (100));
end;
UpdateButtonClick (self);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -