📄 other_graphic.pas
字号:
unit other_graphic;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeEngine, Series, ExtCtrls, TeeProcs, Chart, StdCtrls, Buttons,
Grids, ValEdit, ComCtrls;
type
TF_other_graphic = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
vl: TValueListEditor;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
Chart1: TChart;
Series1: TPointSeries;
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_other_graphic: TF_other_graphic;
implementation
uses main;
{$R *.dfm}
procedure TF_other_graphic.BitBtn2Click(Sender: TObject);
begin
close;
end;
procedure TF_other_graphic.BitBtn1Click(Sender: TObject);
var
i,j:integer;
r:real;
s:string;
begin
chart1.Visible:=false;
with main.DataModule2 do
begin
aq1.Close;
aq1.SQL.Clear;
aq1.SQL.Add('select * from 知识点表');
aq1.Open;
while not aq1.Eof do
begin
s:=trim(aq1.FieldValues['name'])+'【'+trim(aq1.FieldValues['subname'])+'】';
i:=aq1.FieldValues['总出题次数'];
if (i=0) then r:=1
else
r:=(1.0*aq1.FieldValues['答对次数'])/aq1.FieldValues['总出题次数'];
vl.InsertRow(s,floattostr(r*100)+'%',true);
aq1.next;
end;
end;
end;
procedure TF_other_graphic.BitBtn3Click(Sender: TObject);
type
res=record
value:real;
name:string;
end;
var
myres:array[0..100] of res;
index:integer;
i:integer;
r:real;
s:string;
cl:Tcolor;
begin
chart1.Visible:=true;
index:=0;
with main.DataModule2 do
begin
aq1.Close;
aq1.SQL.Clear;
aq1.SQL.Add('select * from 知识点表');
aq1.Open;
while not aq1.Eof do
begin
i:=aq1.FieldValues['总出题次数'];
if (i=0) then r:=1
else
r:=(1.0*aq1.FieldValues['答对次数'])/aq1.FieldValues['总出题次数'];
myres[index].name:=inttostr(index);
myres[index].value:=r;
index:=index+1;
aq1.next;
end;
end;
series1.Clear;
for i:=0 to index-1 do
begin
case (i mod 4) of
0:cl:=clred;
1:cl:=clgreen;
2:cl:=clblue;
3:cl:=clblack;
end;
series1.Add(myres[i].value,myres[i].name,cl);
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -