LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

interactive graph: move a point and update rest of points.

Solved!
Go to solution

Hello,

 

I have a xy graph (see image) which right now works pretty well (the user can change the values during run with the numeric control and the graph updates accordingly). 

 

The problem I have right now is that I want the user to be able to slide the parameters (highlighted in the bottom-left corner of the image) INSIDE the graph, then the program should update the other point-values in the same way as if the change was made from the numeric controls. I tried using cursors to move specific points, but I didn't find a way for the program to understand which numeric control it is supposed to change and to then move the other points affected.. 

0 Kudos
Message 1 of 8
(1,392 Views)

Hey,

 

Right now im sending parameters for a graph by sending data (wavelength, offset and others) manually through buttons and textfields. I was thinking that maybe I could present the user with an interactable graph/image, where the user drags the graph-line itself and the values are automatically moved accordingly. Does anyone know a way of doing this?

 

Thank you very much,

Elias

0 Kudos
Message 2 of 8
(1,450 Views)

Hi Elias,

 


@EliasÅk wrote:

I was thinking that maybe I could present the user with an interactable graph/image, where the user drags the graph-line itself and the values are automatically moved accordingly. Does anyone know a way of doing this?


Use an event structure to handle all those events possible with a graph!

You can detect mouse/keyboard actions, scale changes, cursor movements, …

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(1,419 Views)
Solution
Accepted by topic author EliasÅk

Hi Elias, my graph extensions toolkit for labview might be what you are looking for if you want ways to add overlays, lines, boes, etc to annotate your graph.  You can easily access those annotations then too if you need to use them for other math functions or log them.

 

its free library, check it out here:  https://github.com/unipsycho/Graph-Extensions-LabVIEW

 

Forum thread on it here; https://forums.ni.com/t5/Example-Code/Graph-Extensions-for-LabVIEW/ta-p/3537348

 

Message 4 of 8
(1,397 Views)

Thanks for the answer. I believe this is the way to go, however I don't really know how I put an even for the user clicking and draging on the graph? 

 

The image attached is the graph I want to present to the user, and the variables are what I want the user to be able to fix - by interacting with the graph.

0 Kudos
Message 5 of 8
(1,381 Views)

Hey, I like the library! However I dont think I can use it here for what I want to do? Maybe to extract the parameters, but first I want the user to click the graph and drag the curve itself to the values wanted (see the other answer I wrote for image I want to create).

0 Kudos
Message 6 of 8
(1,380 Views)

Sure, I understand what you mean, my library is an example of how you can detect the events and use them to draw layers on the graph.  You'll have to learn from it to make your own then if you need the specific example you showed.  I've done user built graph profiles exactly like that before, you will have to learn how to handle the events, getting the position and use them to draw a curve that you show on the graph. 

0 Kudos
Message 7 of 8
(1,335 Views)

@EliasÅk wrote:

Hello,

 

I have a xy graph (see image) which right now works pretty well (the user can change the values during run with the numeric control and the graph updates accordingly). 

 

The problem I have right now is that I want the user to be able to slide the parameters (highlighted in the bottom-left corner of the image) INSIDE the graph, then the program should update the other point-values in the same way as if the change was made from the numeric controls. I tried using cursors to move specific points, but I didn't find a way for the program to understand which numeric control it is supposed to change and to then move the other points affected.. 


I used the mac program pro Fit, www.quansoft.com, that has the feature you are looking for; it is a data analysis program. @Mike_King's library is an excellent starting point to implement this feature.

  1. Make a enum or text ring, each value of the enum or text ring is a parameter for your function.
  2. Use the scroll wheel to increase/decrease the chosen parameter. (@Mike_King's library for ranges and mouse wheel can be modified for function parameters.)
  3. The scroll wheel delta value will tell you whether to increase decrease.

mcduff

0 Kudos
Message 8 of 8
(1,315 Views)