question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve mouse interactions in controls

See original GitHub issue

Tasks

This section was added by @swharden

  • trigger mouse enter and leave events in user controls (#1040)
  • provide options for automatic axis limits to ignore axis lines and spans (#1083)
  • implement an axis crosshair label feature (#1093)

Original Question

Your Environment

  • ScottPlot Version: 4.1.12 beta
  • Operating System: Win10 20H2
  • Is it a GUI app? What platform? WinForms
  • .Net: net472 and net5.0-windows was checked.

Simple Mdi Winforms app. Child form with only formsPlot1 on it. MouseLeave and MouseEnter not working, MouseMove is working.

This is critical to implement some info on MouseMove (to hide it after we leave the plot).

P.s. Related question: How to properly implement axes cursor on MouseMove with ScottPlot? image

I was tring something like this:

private void formsPlot1_MouseMove(object sender, MouseEventArgs e)
{
    (double x, double y) = formsPlot1.GetMouseCoordinates();
    _HLine.Y = y;
    _HLine.IsVisible = true;
    _VLine.X = x;
    _VLine.IsVisible = true;
    formsPlot1.Render(skipIfCurrentlyRendering: true);
}

And it’s worked BUT. Because of _HLine and _VLine are plots, ScottPlot autozoom and autoaxes always trying to consider their values. And this lead to whole wrong behavior. For example:

https://user-images.githubusercontent.com/17767561/116545566-47cef280-a8f9-11eb-9c29-ee21ead7fceb.mp4

Cursors must be completely excluded from plotting logic.

Also, is it possible to display Cursor coordinates on the axes (red circles on screen above)?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
swhardencommented, May 17, 2021

MouseEnter and MouseLeave

MouseLeave and MouseEnter not working

These probably are worth forwarding. I’ll try to implement these in the next few days, with a demo. Hiding the crosshairs when the mouse exits the plot seems like a good demo.

Keep in mind that for extreme custom mouse interaction is probably just for the programmer to make their own control and implement the features they want. The controls aren’t very complicated, and it’s much easier to start with the source code and modify it to meet your needs than to try to adapt the standard controls to meet every use case. https://github.com/ScottPlot/ScottPlot/blob/master/src/controls/ScottPlot.WinForms/FormsPlot.cs

Option to ignore axis lines when calling AxisAuto()

The video demonstrates this problem well. Thanks for sharing it! As @StendProg pointed out this question has been raised before. I can add a public field to axis lines so they are ignored when axis limits are determined automatically, which may be a simpler solution.

Labeling crosshair coordinates on the axes

Right now this is not possible, but it should be easy to create a special plot type that does this. I’ll put this idea on the triage list (#1028). This type of behavior would be especially useful for financial charts, similar to https://www.tradingview.com/chart

image

1reaction
bclehmanncommented, May 19, 2021

I noticed in the Avalonia control that OnMouseMove is commented-out. Should this be uncommented or deleted?

It should be replaced with base.OnPointerMoved(e) and uncommented. I did that in #1040

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Improve Mouse Control and Find Your Sens - YouTube
In this video, I explain settings and techniques to instantly improve your mouse control, and ways to practice mouse control.
Read more >
Make your mouse, keyboard, and other input devices ...
Control your mouse with a numeric keypad · To go to the Accessibility settings on your computer, press the Windows logo key+U or...
Read more >
How to improve mouse control : r/summonerschool
How to improve mouse control · Make sure you have a good mouse and mousepad · Play games like Osu or something similar...
Read more >
How can I increase the performance of Windows mouse ...
Three basic options to increase mouse control: 1. Adjust the Mouse Sensitivity and/or Dwell time in Advanced Settings. 2. Make the mouse cursor...
Read more >
Improved mouse control for users with disabilities
Novel software makes fine control of a mouse much easier for users with motor control problems.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found