给你一部分 :)
procedure TForm1.XYCreatebtnClick(Sender: TObject);
var i:integer;
begin
PaintBox1.Refresh;
with PaintBox1.Canvas do
begin
Pen.Width:=2;//坐标轴粗一些
Pen.Color:=clBlack;
MoveTo(30,30); //原点(30,300)
LineTo(30,300); //温度轴即纵轴
LineTo(400,300);//时间轴即横轴
{以下代码画箭头}
MoveTo(25,35);
LineTo(30,30);
LineTo(35,35);
MoveTo(395,295);
LineTo(400,300);
LineTo(395,305);
X.Visible:=true;
Y.Visible:=true;
{以下代码描述坐标轴的虚线格以方便读取坐标}
Pen.Width:=1;
Pen.Color:=clBlack;
Pen.Style:=psDot; //虚线方式
textout(15,305,'0');
for i:=1 to 16 do
begin
moveto(30,(300-15*i));
lineto(390,(300-15*i));
if i mod 2=0 then textout(10,(295-15*i),inttostr(i*5));
end; //这个循环画出了竖直的虚线
for i:=1 to 24 do
begin
moveto((30+i*15),300);
lineto((30+i*15),60);
if i mod 2=0 then textout((25+i*15),305,inttostr(i));
end; //这个循环画出了水平的虚线
haibobtn.Enabled:=true;
XYCreatebtn.Enabled:=false;
end;
end;