From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

number of points in XY graph

Hi every one, I wanted to know if there was a property node to get the number of points displayed on a XY graph,

NIan1234_0-1626212687393.png       how many points are plotted here??

 

And if zoom in, how many points are plotted as follows?

NIan1234_1-1626212697038.png

 

These images are taken from the "XY graph data types.vi", it is in the examples of LabVIEW.

 

 

0 Kudos
Message 1 of 6
(1,173 Views)

The number of points can be found from the value; which you can get from the terminal, from a local variable, or from the Value property.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 6
(1,150 Views)

Maybe I did not explain myself well. What I meant was that I am running LabVIEW, I am seeing the graph, if I zoom in the graph, how can I know the number of points that are being plotted?

 

Thank you

0 Kudos
Message 3 of 6
(1,145 Views)

The XY Graph doesn't indicate the number of points.  But it would be simple to add to the code so as to have a separate indicator for number of points.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 6
(1,134 Views)

Do you want the number of points in the data or the number of points currently visible in the zooned area? You can get the x and y axis ranges from property nodes, then you would iterate over all points with a range check on x and y.

 

There are events for "scale range change". Use that to trigger your calculation.

 

The solution strongly depends on the datatype of the xy graph (complex, cluster of x and y arrays, array of xy points, etc. Single plot? Multiple plots? etc.)

 

Simplest would be to attach a small VI containing the xy graph and typical data and a description how you want to interact with the graph.

0 Kudos
Message 5 of 6
(1,124 Views)

Here is one simple possibility:

 

altenbach_0-1626224884842.png

 

0 Kudos
Message 6 of 6
(1,107 Views)