Always displaying the tracker

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

Robert24 wrote at 2012-06-26 17:57:

I am interested in showing the tracker all the time, not just after a left mouse click when over a graphed item. Can this be added? If not can you point me in the right direction for the best way to implement this feature?

Thanks


objo wrote at 2012-06-27 14:51:

I added this in the issue tracker. See work item 9963!

Currently the tracker is 'following' the series that was nearest at the mouse down point. When it is shown all the time, it needs to 'jump' to the nearest series.

Implementation: I think both the Plot control class and the TrackerManipulator class must be changed. The tracker's Completed method should not hide tracker and not reset the 'current' series. I can look into this later.


Tech_Junkie wrote at 2012-07-19 11:15:

A hopefully smaller question, but very related.

What would be the best way to show a persistent line in the plot after clicking the graph? This line should be similar to one of the lines in the cross shown from the tracker when the plot is clicked. Just to indicate the clicked value on one of the axes.

Thanks in advance!


objo wrote at 2012-08-08 23:51:

Add an 'annotation'. Try to add a LineAnnotation to the Annotations collection of the PlotModel!


sharethl wrote at 2014-08-04 19:55:

A lineAnnotation doesn't work well for WPF.
In MouseEventExample -> Select range, I added a line annotation that always following the mouse, but PlotView cannot fire mouse events.
How come the annotation blocked mouse event from firing?
Note: WinForm works fine.
model.Annotations.Add(range);
var cursor = new LineAnnotation()
{
    Type = LineAnnotationType.Vertical,
    Color = OxyColors.Green,
    ClipByYAxis = false,
};
model.Annotations.Add(cursor);
........
model.MouseMove += (s, e) =>
{
cursor.X = cursor.InverseTransform(e.Position).X;
    if (!double.IsNaN(startx))
    {
        var x = range.InverseTransform(e.Position).X;
        range.MinimumX = Math.Min(x, startx);
        range.MaximumX = Math.Max(x, startx);
        range.Text = string.Format("∫ cos(x) dx =  {0:0.00}", Math.Sin(range.MaximumX) - Math.Sin(range.MinimumX));
        model.Subtitle = string.Format("Integrating from {0:0.00} to {1:0.00}", range.MinimumX, range.MaximumX);
        
        e.Handled = true;
    }
    model.InvalidatePlot(false);
};