procedure TfrmHistory.Chart1ClickBackground(Sender: TCustomChart;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var Xpos:Double;
begin
if (X >= Chart1.BottomAxis.IStartPos) and
(X <= Chart1.BottomAxis.IEndPos) and
(Y > 15) and (Y < 255) then begin
Xpos := Series1.XScreenToValue(x); // Xpos로 Click한 지점의 BottomAxis를 알아냈습니다.
// 그런데 Click한 지점에 Series1의 데이터가 있으면, YValue를 알아낼려고 하는데요..도통 함수를 찾아봐도 안보이네요 ㅡㅡ;;
아시는분좀 가르쳐주세요...부탁부탁...
Chart1.Repaint;
Chart1.Canvas.Pen.Style := psSolid;
Chart1.Canvas.Pen.Color := clBlue;
Chart1.Canvas.MoveTo(X,16);
Chart1.Canvas.LineTo(X,255);
end;
end;
|