Display tracker when the scatter point is selected

Oystein Bjorke 4 years ago 0
This discussion was imported from CodePlex

Gimly wrote at 2013-10-01 17:52:

So, I've been using the new way to select a single scatter point of a series. (thanks for updating my simple example by the way, very useful!)

The only issue I have with it is that it removes the tracker functionality.

I think it could be quite nice to display the tracker when the point is selected. Is there a way to programatically display the tracker for a point yet?

objo wrote at 2013-10-01 22:04:

Alt. 1: Remove e.Handled=true - then the event will be passed to the tracker
Alt. 2: You have PlotModel.PlotControl.ShowTracker but you must build the tracker hit result yourself - it contains more information than the mouse hit result. Also remember to call HideTracker.

Gimly wrote at 2013-10-02 08:55:

Thanks objo, it wasn't working with the e.Handled=true removed because the PlotModel.MouseDown is called even if the Series.MouseDown has been called (which is totally normal but it hadn't triggered in my head), which meant that my points were getting unselected directly.

I fixed it by simply testing if e.HitTestResult == null, if it's null => I'm clearing the selection, otherwise I don't do anything.

Works like a charm.

objo wrote at 2013-10-03 19:26:

Good idea, I changed the example!
CodePlex