1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
| unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, VCLTee.TeEngine, VCLTee.Series,
Vcl.ExtCtrls, VCLTee.TeeProcs, VCLTee.Chart, Vcl.Grids, Vcl.StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
StringGrid1: TStringGrid;
Chart1: TChart;
Series1: TLineSeries;
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var i: integer;
begin
Series1.Add(0);// facultatif
for I := 1 to 10 do
begin
if (stringGrid1.Cells[0,i]<>'')AND(stringGrid1.Cells[1,i]<>'')AND(stringGrid1.Cells[2,i]<>'') then
Series1.AddXY(StrtoFloat(stringGrid1.Cells[1,i]),StrtoFloat(stringGrid1.Cells[2,i]));
end;
series1.Active:=True;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
stringGrid1.Cells[0,1]:='1';
stringGrid1.Cells[0,2]:='2';
stringGrid1.Cells[0,3]:='3';
stringGrid1.Cells[0,4]:='4';
stringGrid1.Cells[0,5]:='5';
stringGrid1.Cells[0,6]:='6';
stringGrid1.Cells[0,7]:='7';
stringGrid1.Cells[0,8]:='8';
stringGrid1.Cells[0,9]:='9';
stringGrid1.Cells[0,10]:='10';
stringGrid1.Cells[1,1]:='1';
stringGrid1.Cells[1,2]:='2';
stringGrid1.Cells[1,3]:='3';
stringGrid1.Cells[1,4]:='9';
stringGrid1.Cells[1,5]:='5';
stringGrid1.Cells[1,6]:='3.5';
stringGrid1.Cells[1,7]:='7';
stringGrid1.Cells[1,8]:='8';
stringGrid1.Cells[1,9]:='15'; //X, dans ce cas, ce point n'est pas affiché???
stringGrid1.Cells[1,10]:='9';
stringGrid1.Cells[2,1]:='1';
stringGrid1.Cells[2,2]:='2';
stringGrid1.Cells[2,3]:='3';
stringGrid1.Cells[2,4]:='8';
stringGrid1.Cells[2,5]:='5';
stringGrid1.Cells[2,6]:='3';
stringGrid1.Cells[2,7]:='7';
stringGrid1.Cells[2,8]:='8';
stringGrid1.Cells[2,9]:='10'; //dont Y
stringGrid1.Cells[2,10]:='9.5';
end;
end. |
Partager