在chart 的OnMouseMove事件中写如下代码:
procedure TF_test.Chart4MouseMove(Sender: TObject;
Shift: TShiftState;
X,
Y: Integer);
Var
buf_x,buf_y
ouble;
begin
chart4.Series[0].GetCursorValues(buf_x,buf_y);
If (Round(buf_y*1000)>0)And(Round(buf_y*1000)<=Round(
Chart4.LeftAxis.Maximum*1000))And(Round(buf_x*1000)>
0)And(Round(buf_x*1000)<=Round(Chart4.BottomAxis.Maximum*1000)) then
begin
StatusBar2.Panels[0].Text:='Y轴:'+ Format('%1.3f',[buf_y])+' MPa ';
StatusBar2.Panels[1].Text:='X轴:'+ Format('%1.3f',[buf_x])+' S ';
End
else
begin
StatusBar2.Panels[0].Text:='';
StatusBar2.Panels[1].Text:='';
end;
end;
另外双击chart 在编辑器中选择Tools页点击Add按扭选取other页用Annotation进行属标
取点则更加灵活