11-18-2024 07:24 AM
Hello, so i am not really familiar with labview, but i am trying to make something with graphs. Is it possible to make a graph so you can move around, and the linear line just keeps going (following the function) kinda like geogebra does? This isnt my main vi, its just to try if this is possible. You see on the picture, that the line just stops, that is because my x values just go to 3 but it isnt possible to get an infinite amount of values as that would just crash my laptop.
Ty for the help
Solved! Go to Solution.
11-18-2024 09:34 AM
@somelabguy wrote:
... Is it possible to make a graph so you can move around, and the linear line just keeps going (following the function) kinda like geogebra does?
Of course! You need to capture user input, then adjust the plot accordingly. You can get/set the plot information using a property node like this:
And to get user input you will need an event structure which you can lean how to do here:
https://www.ni.com/en/support/documentation/supplemental/06/event-driven-programming-in-labview.html
11-18-2024 11:00 AM
@somelabguy wrote:
Hello, so i am not really familiar with labview, but i am trying to make something with graphs. Is it possible to make a graph so you can move around, and the linear line just keeps going (following the function) kinda like geogebra does? This isnt my main vi, its just to try if this is possible. You see on the picture, that the line just stops, that is because my x values just go to 3 but it isnt possible to get an infinite amount of values as that would just crash my laptop.
Ty for the help
All you have is a one-shot downhill VI so all it will do it graph the existing array values, then stops. (I really hoe you are not using "continuous run" mode!)
Please explain all your vague terms. For example what is "move around"? (change array values? Do something with the mouse? Move your chair? Something else?)
it almost seems to be that you just want the linear graph extend past the existing values. For that you can create a linear x-ramp and do a linear evaluation using the slope and intercept from the fit.
You failed to attach your code containing typical data, else I could fix it for you in 30 seconds.
11-18-2024 11:11 AM - edited 11-18-2024 11:22 AM
Maybe this is what you want?
Since you seem to like pictures of code, I am not attaching a VI yet)
Note that for a linear fit, a ramp with two points would be sufficient. I typically use polynomials and once you have a curved fit, you would need to generate a sufficient ramp as shown. This is more flexible and scalable and a linear fit would just a the special case of a first order polynomial.
11-18-2024 11:22 AM
@altenbach wrote:
Note that for a linear fit, a ramp with two points would be sufficient. I typically use polynomials and once you have a curved fit, you would need to generate a sufficient ramp as shown. This is more flexible and scalable and a linear fit would just a the special case of a first order polynomial.
Here's the more general version showing a quadratic fit. Just change the poly order to 1 for the previous (linear) result.
11-18-2024 06:15 PM - edited 11-18-2024 06:37 PM
Hey im sorry i must have done something wrong if my vi didn't attach.
I have been also experimenting with multiple graphs in 1 now, i will put in what i have made untill now.
By move around, i mean use my cursor on the graph, to move the graph around, it is with that little menu in the bottom left of my graph display, that is what i mean. So if i move it around (move the x and y with my cursor on the graph by dragging and holding left click) and keep following the line, it just keeps going.
I can't thank you enough already for the tips you already gave me, saved me a lot of time, couldn't find this info anywhere! The vi should be linked here somewhere now.
What i want is kinda like this app called geogebra, no matter how much i zoom out or move around, the line just keeps going and never stops. I am sorry if i am not explaining it well, english isn't my first language.
11-18-2024 11:20 PM
By "moving around", all that's really happens is a change in the min/max of the x and y scale. A linear line does not really depend on any of that and should always show as line. Right?
11-19-2024 03:10 AM
yea i just want it so the line doesn't stop, can you do that?
11-19-2024 03:59 AM
It seems like you want to scroll through a plot of a function, which is possible. But you will have to LabVIEW which points to plot because it cannot store an infinite numbers of points (nor can any other piece of software).
This might get you started.
11-19-2024 04:47 AM
Hey, could you do this to my vi? I would really apreciate that. TYSM you found what i was looking for!