for i := 0 to LBBH.Items.Count - 1 do begin DBChartDis.SeriesList[i].Active := True; Canvas.TextOut('2007-8-24','初始测量值','编号'); \\318行 if i = 0 then with adoDis1 do begin Close; SQL.Clear; SQL.Text := 'Select * From bs_Displacement Where 编号=' + QuotedStr(LBBH.Items.Strings[0]) + ' and 测量日期 Between ' + StartDate + ' and ' + EndDate; Open; end; if i = 1 then with aDoDis2 do .......... ....... --------------------------------- 是这样写吗 编译提示错误 [错误] Unit_deformation.pas(318): Incompatible types: 'Integer' and 'String'
procedure TForm1.Chart2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var I:Integer; begin if Series2.GetCursorValueIndex>-1 then Chart2.Canvas.TextOut(x,y,'红色'); if Series1.GetCursorValueIndex>-1 then Chart2.Canvas.TextOut(x,y,'绿色') end;参考
begin
DBChartDis.SeriesList[i].Active := True;
Canvas.TextOut('2007-8-24','初始测量值','编号'); \\318行
if i = 0 then
with adoDis1 do
begin
Close;
SQL.Clear;
SQL.Text := 'Select * From bs_Displacement Where 编号=' + QuotedStr(LBBH.Items.Strings[0])
+ ' and 测量日期 Between ' + StartDate + ' and ' + EndDate;
Open;
end;
if i = 1 then
with aDoDis2 do
..........
.......
---------------------------------
是这样写吗
编译提示错误 [错误] Unit_deformation.pas(318): Incompatible types: 'Integer' and 'String'
x和y是坐标,integer型的,text是你要显示的文字内容
Y: Integer);
var
I:Integer;
begin if Series2.GetCursorValueIndex>-1 then
Chart2.Canvas.TextOut(x,y,'红色');
if Series1.GetCursorValueIndex>-1 then
Chart2.Canvas.TextOut(x,y,'绿色')
end;参考