Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
645
Suppress ToolTip when handling mouse enter event
posted

In this question: http://forums.infragistics.com/forums/t/49255.aspx Graham provided a good solution to the situation where points overlapped on a mouse click by popping up a control to display the points.

Now, looking a bit further at the situation, I'd like to perform the same sort of thing when doing a mouseover on the series. To handle this, I handled the series MouseEnter event, grabbed the current mouse position, computed the X and Y offset of the series, adjusted the mouse position for that offset and used that position to determine what points were under the mouse (or close to it). Something like this:

Point point = Mouse.GetPosition(xamDataChart1);

double diffW = xamDataChart1.ActualWidth - e.Series.ActualWidth;

double diffH = xamDataChart1.ActualHeight - e.Series.ActualHeight;

point.X = point.X - diffW;

point.Y = point.Y - diffH;

// basically do GetHitHitems except pass in point rather than e.Item.

This works swimmingly well except that sometimes I get the ToolTip for one of the overlapping points popping up rather than my own Popup listing the points.

Any ideas how to avoid this happening?