LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot a text on XY Graph

Solved!
Go to solution

Hello,

 

Does exist some technique that allow to plot a text note on XY Graph.

For example text "AAAAAA" put close to left-top corner of XY Graph.

Thanks.

0 Kudos
Message 1 of 10
(6,373 Views)

Yes - there is a property of the XY graph called PlotImages.front. You would use the picture functions to create an image with text, lines, shapes, or whatever else, and set that image to the graph using a property node. 

 

There are some good examples in this thread:

https://lavag.org/topic/17756-xy-graph-programmatically-add-point-labels/

 

0 Kudos
Message 2 of 10
(6,360 Views)

Hi Pavel,

 

read about the annotations in graphs - they allow text in graphs without creating additional images…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 10
(6,355 Views)

Gerd's suggestion is the correct one.  Here is a link on how to add annotations to your plot.  It says "waveform graph" but the property calls are the exact same.

 

http://digital.ni.com/public.nsf/allkb/FB0063E1BC9AD54B8625751C00202C81

Message 4 of 10
(6,348 Views)

BowenM a écrit :

Gerd's suggestion is the correct one.  Here is a link on how to add annotations to your plot.  It says "waveform graph" but the property calls are the exact same.

 

http://digital.ni.com/public.nsf/allkb/FB0063E1BC9AD54B8625751C00202C81


Thanks GerdW and BowenM,

 

I've just tried this example (in my LabVIEW 2015 the property is a little bit different).

Unfortunately I don't see annotation.

What is wrong in my setup ?

 

 

Annotation_on_Graph.png

0 Kudos
Message 5 of 10
(6,329 Views)

Hi,

 

It looks like the Annotation is linked with a plot. When you insert a Plot(0) to the graph, the annotation will appear.

 

Regards,

Marc

0 Kudos
Message 6 of 10
(6,281 Views)

Marc67 a écrit :

Hi,

 

It looks like the Annotation is linked with a plot. When you insert a Plot(0) to the graph, the annotation will appear.

 

Regards,

Marc


Thanks Marc,

 

Resolved, the problem was in incorrect coordinate settings.

I sought that they are in pixel, whereas they are in scale units, so values 20,20 were out of scale.

Here is as it looks.

What is a bit annoying in this apporoach, it requires rather significant staff for relatively simple operation:

  1. Generate constant of type AnntList
  2. Extract an element from array AnntList
  3. Create a claster of type "AnntList element"
  4. Assign values to this cluster (at least between "Name" and "Position" fields)
  5. Transform this clster in array
  6. and finally apply it to AnntList property

text_on_XYGraph_solutuin.JPG

 

0 Kudos
Message 7 of 10
(6,272 Views)

Here is probably the simplest version (that uses In Place Element Structure

Anyway it requires to assign all fields between "Name" and "Position"

Annotation_on_Graph (1).png

0 Kudos
Message 8 of 10
(6,259 Views)

Actually the shortest version is here.

The Bundle By Name block allows to limit the number of properties that user want to change to a strict minimum.

Then the property at the position X can be easily replaced by clicking on the position X and selecting some another property from the list that opens

Annotation_on_Graph (2).png

0 Kudos
Message 9 of 10
(6,177 Views)
Solution
Accepted by topic author Pavel_47

Previous version is erroneous - it works only if an annotation already exists on graph.

If no annotation it doesn't work.

Here is the solution for empty graph:

put_text_on_XYGrapg (2).png

 

0 Kudos
Message 10 of 10
(6,096 Views)