Page 1 of 1

MouseClick event for graph background

Posted: Wed Apr 15, 2015 7:19 am
by jrvdboom
I can detect clicks on axes, titles, series, etc. through their MouseClick events. But how can I handle events where the user clicks the graph background?

Re: MouseClick event for graph background

Posted: Wed Apr 15, 2015 6:41 pm
by ArctionPasi
Hi,

chart.ViewXY.GetMarginsRect() reports the graph edges. By calling that in chart.MouseClick or similar event you get the info.

This approach of course doesn't suit well for purposes where you want respond to mouse only when another chart object, like axis or series, is not under the mouse.