A lineAnnotation doesn't work well.
In MouseEventExample -> Select range, I added a line annotation that always following the mouse, but PlotView cannot fire mouse events.
In MouseEventExample -> Select range, I added a line annotation that always following the mouse, but PlotView cannot fire mouse events.
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); };