⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphic_exam.~pas

📁 学员管理的软件
💻 ~PAS
字号:
unit graphic_exam;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, TeEngine, Series, ExtCtrls, TeeProcs, Chart;

type
  TF_exam_graphic = class(TForm)
    Chart1: TChart;
    Series1: TPieSeries;
    procedure FormShow(Sender: TObject);
    procedure Chart1DblClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  F_exam_graphic: TF_exam_graphic;

implementation
uses main;
{$R *.dfm}

procedure TF_exam_graphic.FormShow(Sender: TObject);
var
s:string;
i:integer;
cl:Tcolor;
begin
   i:=0;
   series1.Clear;
   chart1.Title.Text[0]:='各试卷试题分布图';
   with main.DataModule2 do
   begin
     aq1.Close;
     aq1.SQL.Clear;
     aq1.SQL.Add('select 所属试卷,count(*) as num from 试题表 group by 所属试卷');
     aq1.Open;
     while not aq1.Eof do
     begin
       aq2.Close;
       aq2.SQL.Clear;
       aq2.SQL.Add('select * from 试卷表 where 试卷号='+inttostr(aq1.FieldValues['所属试卷']));
       aq2.Open;
       s:=trim(aq2.FieldValues['试卷名称'])+'['+trim(aq2.FieldValues['出卷人'])+']';
       case (i mod 6) of
       0:
       cl:=clred;
       1:
       cl:=clgreen;
       2:
       cl:=clblue;
       3:
       cl:=clwhite;
       4:
       cl:=clbtnface;
       5:
       cl:=clblack;
       end;
       inc(i);
       series1.Add(aq1.FieldValues['num'],s,cl);
       aq1.Next;
     end;
   end;
end;

procedure TF_exam_graphic.Chart1DblClick(Sender: TObject);
begin
close;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -