Tracker

May 30, 2012 at 4:54 PM

Please be gentle as I am quite new to Oxyplot and am strugling with the lack of documentation.  I've got a couple of Tracker questions:

1st - is it possible to constanly show the Tracker?  I have found the methods for Show and Hide, but I don't want it to keep getting hidden when a mouse button is released.

2nd - is it possible to get and set the position of the tracker from outside the control?

3rd - Which is the best event to register to which fires when someone changes the tracker position on the graph?

 

Many thanks!

Coordinator
May 30, 2012 at 9:12 PM

1: Currently it is not. We can add a property that will not hide the tracker when the mouse button is released (but when I implemented it, I did not wish this behaviour). The code that hides the tracker is in the TrackerManipulator class.

2: You can get the mouse position, then transform to data coordinates (use axes/PlotModel methods)

3: It should be possible to subscribe to the MouseMove/PreviewMouseMove of the Plot control (I have not tested). The tracker control and tracker maniplautor are currently not raising any events.

Jul 19, 2012 at 9:10 AM
Edited Jul 19, 2012 at 9:11 AM

I "solved" the third point by adding mousehandlers to the PlotModel like this:

Constructor:
        PlotModel.MouseDown += Mouse_Down;
} 

private void Mouse_Down(object sender, OxyMouseEventArgs e)
        {
            if (e.ChangedButton == OxyMouseButton.Left)
            {
                <... do stuff>

                e.Handled = true; // all handled, do not set if other handlers need to do something
            }
        }

Similar handlers can be written for the MouseUp and MouseMove. Combining those should make it possible to know when the tracker should also be moved.

Apr 3, 2013 at 8:55 AM
Visual Studio is giving error Error
No overload for 'plot_Mousedown' matches delegate 'System.Windows.Forms.MouseEventHandler'
Jan 8, 2014 at 6:37 PM
1st - is it possible to constanly show the Tracker? I have found the methods for Show and Hide, but I don't want it to keep getting hidden when a mouse button is released.
I've got the same need.
1: Currently it is not. We can add a property that will not hide the tracker when the mouse button is released (but when I implemented it, I did not wish this behaviour). The code that hides the tracker is in the TrackerManipulator class.
Is this property implemented? I can easily fork the this feature into code, but in long time it would be better if I could use the official versions.