LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why my XY chart does not work?

Solved!
Go to solution

"I have searched the examples but none of them use XY graph. Is it even possible to chart in real time using this XY graph? "

 

1) then you should try again (e.g. "XY Graph Data Types.vi")

2) note that there is a difference between charts and graphs, the first keeps an internal buffer/history, and new values are appended, second displays only what is input to them  (and to answer your question YES)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 11 of 24
(3,107 Views)

Here is an idea, based on something I saw here. I can take the values from the Sine functions, build them into array and use a shift register to add points at each iteration. I can send each vector to an axis on the XY graph and it will plot all the available points.

0 Kudos
Message 12 of 24
(3,101 Views)

yup, so far everyone (including me in my answer before switched X and Y)

try this:

xy-graph-example.png

xy-graph-example-fp.png


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
Message 13 of 24
(3,089 Views)

Copying from detailed help, available when using the Context Help (Ctrl-H) and hovering over an XY Graph terminal.

 

Displaying a Single Plot on XY Graphs
The XY graph accepts three data types for single-plot XY graphs. The XY graph accepts a cluster that contains an x array and a y array.

The XY graph also accepts an array of points, where a point is a cluster that contains an x value and a y value. The XY graph also accepts an array of complex data, in which the real part is plotted on the x-axis and the imaginary part is plotted on the y-axis.

Displaying Multiple Plots on XY Graphs
The XY graph accepts three data types for displaying multiple plots. The XY graph accepts an array of plots, where a plot is a cluster that contains an x array and a y array.

The XY graph also accepts an array of clusters of plots, where a plot is an array of points. A point is a cluster that contains an x value and a y value. The XY graph also accepts an array of clusters of plots, where a plot is an array of complex data, in which the real part is plotted on the x-axis and the imaginary part is plotted on the y-axis.

 

This section of the help is very useful, but I have to re-read it almost every time I want multiple plots. In your case, you currently only want a single plot, so that's a little simpler. In my snippet, I showed the use of the second option: "an array of points, where a point is a cluster that contains an x value and a y value".

 


GCentralI'm attending the GLA Summit!
0 Kudos
Message 14 of 24
(3,088 Views)

ps: the color (and thus type) of the xy-graph on the block diagram changes depending what you wired into it

(in this thread we have brown and pink/red so far)

 

have a look at the labview examples again, especially the "XY Graph Data Types.vi"


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 15 of 24
(3,084 Views)

@jwscs wrote:

@Wentao_Ji ... plz check your vi, it doesnt work! you made the same error as OP


I thought the OP wanted something like a Lissajous curve.

0 Kudos
Message 16 of 24
(3,070 Views)

i don't know what that is, but if its a thing .. that might be my fault then :cheers:

 

 

TIL https://en.wikipedia.org/wiki/Lissajous_curve


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 17 of 24
(3,062 Views)

@cookie_monster9 wrote:

Here is an idea, based on something I saw here. I can take the values from the Sine functions, build them into array and use a shift register to add points at each iteration. I can send each vector to an axis on the XY graph and it will plot all the available points.


You are right here.

 

I thought your question was about differentiating a graph from a chart. Basically, what you want is to make a graph to behave like a chart, I guess that's what you mean by "in real time". That is going to require your extra code to maintain a history for the graph, as the chart will do automatically, and that's what everyone was talking about.

 

As @cbutcher and @jwscs have also mentioned, it is also possible to display multiple plots on one XY Graph, if that was your intention.

0 Kudos
Message 18 of 24
(3,056 Views)

Yes, that's what I was thinking. The image on the Wikipedia page just reminds me of the first time of playing around with oscilloscopes and waveform generators. Smiley Happy

0 Kudos
Message 19 of 24
(3,053 Views)

Wentao_Ji wrote:

As @cbutcher and @jwscs have also mentioned, it is also possible to display multiple plots on one XY Graph, if that was your intention.


To be clear, my snippet only plotted one curve, of the lissajous curve type.

 

Edit: I failed to read clearly enough. Sorry! Sadly I can't delete my post, so an apologetic edit is the best I can manage.


GCentralI'm attending the GLA Summit!
0 Kudos
Message 20 of 24
(3,048 Views)