Select data-points from 2D scatter plot #855
-
|
Hello, I'm a newbie with regards to GUI and WinForms so I may not understand some concepts that may seem obvious to you. I find ScottPlot to be an amazing library (and Id like to contribute in the future). I would like to implement a small change to the mouse actions that allows the user to select a subset of data points from a 2D scatter plot. Similar to what this image shows: https://imgur.com/a/O7HWkkC . The idea being the user can right click and drag to create a box, where all data points inside the box are highlighted (and thus the back-end code would know what points the user wants to work on). Right click drag default control would be disabled as I have no need to scale/pan the graph. On that note, if someone recognizes which library was used to create the software on the image that would also be helpful. Ive (successfully) gone through the mouse-position tutorial but then found this discussion on customizing left-click behaviour which I cannot follow as I don't understand how to "add your own click events on top of the ones ScottPlot has". I downloaded ScottPlot into vs2019 through the vs NuGet manager. Using WinForms. v4.1.9-beta (in case this is relevant) If anyone can shed some light into how would one go around to implement what I ask for it would be greatly appreciated. Thank you for your time and to Scott for creating this amazing library. UPDATE: Ive managed to make a custom right click event with the following lines |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
This comment has been hidden.
This comment has been hidden.
-
|
Hi Scott thank you for your answer but I will still mark the thread as unanswered if you don't mind in case someone else wants to chip in, and also since your answer still leaves me with more unknowns.. I'm trying to break the whole process down into small steps so I can deal with them and learn about GUI structures as I go. My most immediate problem right now then is that I don't know how to trigger a custom function when the mouse button is pressed. I tried messing around with Thanks again! |
Beta Was this translation helpful? Give feedback.
Hi Scott thank you for your answer but I will still mark the thread as unanswered if you don't mind in case someone else wants to chip in, and also since your answer still leaves me with more unknowns..
I'm trying to break the whole process down into small steps so I can deal with them and learn about GUI structures as I go.
My most immediate problem right now then is that I don't know how to trigger a custom function when the mouse button is pressed. I tried messing around with
MouseDownandMousClickbut it didnt help. This is what I tried:formsPlot1.MouseDown += formsPlot1_MyMouseDown;formsPlot1.MouseClick += formsPlot1_MyMouseDown;As mentioned earlier I did manage to call a custom …