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:
| procedure TForm1.Button2Click(Sender: TObject); var I,J : Integer; function lw(s:string):string; begin repeat if copy(s,1,1)=' 'then s:=copy(s,2,length(s)-1); until (copy(s,1,1)<>' ')or(s=''); repeat if copy(s,length(s),1)=' 'then s:=copy(s,1,length(s)-1); until (copy(s,length(s),1)<>' ')or(s=''); lw:=s; end;
function alsD(s:string):double; var c:integer; d:double; begin for c:=1 to length(s) do if s[c]=',' then s[c]:='.'; val(lw(s),d,c);if c<>0 then alsD:=-0 else alsD:=d;end;
begin for I := 1 to 2 do begin Chart1.Series [I-1].Clear; for J := 1 to StringGrid1.RowCount-2 do begin Chart1.Series [I-1].Add(alsD(StringGrid1.Cells[I,J]),'', Chart1.Series [I-1].SeriesColor); Chart1.Series [I-1].Marks.Visible := true; end; end; end; |