procedure TDBQX.DBChart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
{ This procedure draws the crosshair lines }
Procedure DrawCross(AX,AY:Integer);
begin
With DBChart1,Canvas do
begin
Pen.Color:=clYellow;
Pen.Style:=psSolid;
Pen.Mode:=pmXor;
Pen.Width:=1;
MoveTo(ax,ChartRect.Top-Height3D);//画十字架
LineTo(ax,ChartRect.Bottom-Height3D);
MoveTo(ChartRect.Left+Width3D,ay);
LineTo(ChartRect.Right+Width3D,ay);
end;
end;
Var tmpX,tmpY:Double;
lab,str:string;
i:integer;
ss:TFastLineSeries;
begin
DBChart1.Cursor:=crCross;
DBChart1.OriginalCursor:=DBChart1.Cursor;
DBChart1.Repaint;
if (OldX<>-1) then
begin
DrawCross(OldX,OldY); // 画旧点
OldX:=-1;
end;
if PtInRect( DBChart1.ChartRect, Point(X-DBChart1.Width3D,Y+DBChart1.Height3D) ) then
begin
DrawCross(x,y); // 画新点并保存
OldX:=x;
OldY:=y;