TheWizard
TheWizard

Reputation: 59

c# How to get point data from chart on click?

I'm trying to get a point on a chart that the user pressed. From what I see and researched, the Click and MouseClick events only give you information about the mouse position in pixels on the window. is there a way to get information about the point pressed?

Upvotes: 1

Views: 2412

Answers (1)

TheWizard
TheWizard

Reputation: 59

using Chart.HitTest you get an HitTestResult type object that holds information about the location pressed. Then you can do whatever you want with it.

https://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.hittestresult(v=vs.110).aspx

Upvotes: 2

Related Questions