I have a LineSeries chart. By series.IsSelectionEnabled = true;
when I move the mouse over the points, I can select that node. But how can I do it when the mouse is not exactly over the point but when it's near it (above or under)? Thanks.
PS: One more thing. How can I change the color of the column when the mouse is over it so the user can tell which one of the columns he/she is going to select.
I have created the example of the chart with the single
LineSeries
. You can click anywhere at the plot and the nearest point will be selected.XAML (Change the
ItemsSource
property and other properties to yours):Code-behind:
As I said this chart will select the nearest point even if you click at a great distance away from any chart point. If it isn't intended behavior, you can uncomment these lines and set any number in pixels:
I have written comments, but if something isn't clear you can ask and I will explain.