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
25
HighDensityScatterSeries.ScatterMouseOver event is not raised; how to find all data points under mouse cursor?
posted

I am using a HighDensityScatterSeries in a XamDataChart in my WPF application. This is with Infragistics Ultimate 2014.1 and .NET 4.5. I need to know which items the user is pointing to as they move the mouse cursor across the high density series.

The series defines an event called ScatterMouseOver which is supposed to publish a ScatterMouseOverEventArgs containing the NearestItems. However, this event does not get published.

I am instead using MouseMove and MouseLeave events to do this processing on my own, along with the HighDensityScatterSeries.GetItemFromSeriesPixel() method. This does work, but the method only provides the single best matching data item, instead of all matches. I need all of the matches.

Is there another way to determine all matching items under the mouse cursor in the data series? I tried using the GetSeriesLowValueFromSeriesPixel and GetSeriesHighValueFromSeriesPixel methods so that I could then query my data set on my own, but those methods both return double.NaN so those don't work for me, either.

You can reproduce this problem in the Infragistics Samples Browser by adding the ScatterMouseOver event to the chart in BindingHighDensityData.xaml:

           
                <ig:HighDensityScatterSeries
                    XAxis="{Binding ElementName=numericXAxis}"
                    YAxis="{Binding ElementName=numericYAxis}"
                    ItemsSource="{Binding}"
                    XMemberPath="XValue"
                    YMemberPath="YValue"
                    ProgressiveLoadStatusChanged="OnSeriesProgressiveLoadStatusChanged"
                    MouseOverEnabled="True"
                    ScatterMouseOver="HighDensityScatterSeries_ScatterMouseOver">

                 ...

        private void HighDensityScatterSeries_ScatterMouseOver(object sender, ScatterMouseOverEventArgs e)
        {
            MessageBox.Show("ScatterMouseOver event was raised");
        }

You'll see that the message box is never shown, whereas if you instead use the MouseMove event, then the message box is shown.

Parents
  • 34430
    Suggested Answer
    Offline posted

    Hello Jonathan,

    Thank you for your post.

    Currently, while the HighDensityScatterSeries in the XamDataChart does expose a ScatterMouseOver event, this event is not currently fired as it wasn't really ever implemented. My recommendation to you is to handle the XamDataChart.SeriesMouseMove event. The event arguments of this event's handler has an Item property, which will allow you to get the particular data item that the mouse has moved over in a particular series. In the case that you have multiple series in your XamDataChart, these event arguments also have a Series property that you can check if you only want to get the items for a particular series in your chart.

    Unfortunately, this still won't give you every point that exists on a particular part of that chart - it will only yield the top-most one. If you would like to get all of the points at a particular mouse-point in your chart, I would recommend querying the ItemsSource that you have bound to a particular series. You can also do this by continuing with the usage of the MouseMove and MouseLeave events on the series itself.

    Regarding the ScatterMouseOver event's implementation, if you would like to see this event implemented into the XamDataChart's scatter-based series in the future, consider placing a new product idea for it at http://ideas.infragistics.com.  Submitting your idea will allow you to communicate directly with our product management team, track the progress of your idea at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.

    Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it.  You can also link back to this thread for additional details.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

Reply Children
No Data