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?
Yes - I guess what I could do is avoid setting the tooltip property on the series and instead use the same popup I use for multiple points for the single point "tooltip" - that'll likely fix the issue and really isn't but a couple lines of code.
Regards,
Matt
Hello Jamie,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support
Are you setting the tooltip property on the series? If you are doing your own tooltip handling you should perhaps not set our tooltip property, so that it doesnt pop up at inappropriate times. Maybe I'm misunderstanding though. Also, if you want to prevent containing controls from getting an event that you want to handle yourself you should set e.Handled = true. Which will prevent the event from propagating higher. Depending on what you are doing though, this could interfere with other features of the control.
-Graham