📄 jgyhzjlxfxtx.pas
字号:
unit JGYhZjLxFxTx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, VCFI, ComCtrls, ImgList, ToolWin, ExtCtrls,
VtChartLib6_TLB,uConstUtils, Types;
type
//T2DArray = array of array of double;
TFormJGYhZjLxFxTx = class(TForm)
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
ImageList1: TImageList;
ImageList2: TImageList;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
ToolButton5: TToolButton;
ToolButton6: TToolButton;
ToolButton7: TToolButton;
Panel1: TPanel;
StatusBar1: TStatusBar;
ToolButton8: TToolButton;
VtChart1: TVtChart6;
ToolButton9: TToolButton;
ToolButton10: TToolButton;
procedure ToolButton4Click(Sender: TObject);
procedure ToolButton7Click(Sender: TObject);
procedure ToolButton9Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
// aCol,aRow:array of string;
// aCol,aRow:TStringDynArray;
// iDs,iYd:smallint;
procedure SetGraph(aCol,arow:TStringDynArray;aData:TArray2D;const Swap:boolean=false);
procedure SetGraph1(aCol,arow:TStringDynArray;aData:TArray2D;const Swap:boolean=false);
end;
var
FormJGYhZjLxFxTx: TFormJGYhZjLxFxTx;
implementation
//uses JGYhSjCx1;
{$R *.dfm}
procedure TFormJGYhZjLxFxTx.SetGraph(aCol,arow:TStringDynArray;aData:TArray2D;const Swap:boolean=false);
var
i,j,iRow,iCol:smallint;
begin
iRow := high(aRow)+1;
iCol := high(aCol)+1;
// With VtChart1 do
// begin
VtChart1.RowCount := iRow;
VtChart1.ColumnCount := iCol;
for i:=1 to iCol do
begin
VtChart1.Column := i;
VtChart1.ColumnLabel := trim(copy(aCol[i-1],9,30))+' ';
end;
for i:=1 to iRow do
begin
VtChart1.Row := i;
VtChart1.RowLabel := aRow[i-1];
end;
for i:=1 to iCol do
for j:=1 to iRow do
begin
VtChart1.Row:=j;
VtChart1.Column:=i;
VtChart1.data:= floattostr(aData[j-1,i-1]);
end;
// end;
end;
procedure TFormJGYhZjLxFxTx.SetGraph1(aCol, arow: TStringDynArray;
aData: TArray2D; const Swap: boolean);
var
i,j,iRow,iCol:smallint;
begin
iRow := high(aRow)+1;
iCol := high(aCol)+1;
VtChart1.RowCount := iRow;
VtChart1.ColumnCount := iCol;
for i:=1 to iCol do
begin
VtChart1.Column := i;
VtChart1.ColumnLabel := trim(aCol[i-1])+' ';
end;
for i:=1 to iRow do
begin
VtChart1.Row := i;
VtChart1.RowLabel := aRow[i-1];
end;
for i:=1 to iCol do
for j:=1 to iRow do
begin
VtChart1.Row:=j;
VtChart1.Column:=i;
VtChart1.data:= floattostr(aData[j-1,i-1]);
end;
end;
procedure TFormJGYhZjLxFxTx.ToolButton4Click(Sender: TObject);
begin
if ToolButton4.Down then
VtChart1.ChartType :=1
else
if ToolButton5.Down then
VtChart1.ChartType :=3
else
if ToolButton8.Down then
VtChart1.ChartType :=13;
end;
procedure TFormJGYhZjLxFxTx.ToolButton7Click(Sender: TObject);
begin
close;
end;
procedure TFormJGYhZjLxFxTx.ToolButton9Click(Sender: TObject);
begin
{ if ToolButton9.Down then
SetGraph(aCol,aRow,aData,True)
// SetGraph(aRow,aCol,aData,true)
else
SetGraph(aCol,aRow,aData);
}
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -