LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add a legend inside a graph

Solved!
Go to solution

Hello,

 

Is there someone who knows how to add a legend inside a graph ?

 

Best regards,

Fabien

0 Kudos
Message 1 of 6
(2,516 Views)

Hello,

 

In this code for example, I put a property node to make the sub title visible and I get an error.

And if I try to add a text in the sub title property before or after having done a screenshot of the image I want to export, I get an error.

 

Does someone know something about to add a legend inside a graph ?

 

best regards,

Fabien

0 Kudos
Message 2 of 6
(2,515 Views)

Hi Fabien, you could have a look in graph annotations: http://blog.eyesonvis.com/2010/05/19/labview-graph-annotations/

 

I hope this helps.

0 Kudos
Message 3 of 6
(2,505 Views)
Solution
Accepted by topic author fabien-g

Solution

By default, a Caption is not created and no memory is allocated to it. Therefore when you try to programmatically set or read from a Property Node that references the Caption you get an error during run time. The way to fix this is to just create the Caption before the program runs. To do this, right click on the control, go to Visible Items, then select Caption.

Captions can be generated for multiple items at the same time by selecting all desired items before setting the caption to visible. However, captions cannot be set to visible by default, and they cannot be created programmatically. 

 

----------------------------------------

 

Hello,

 

It appears to be the solution but I do not see where is the path to create the caption before the program runs.

 

best regards,

Fabien

 

0 Kudos
Message 4 of 6
(2,504 Views)

Hi AYanez,

 

Thanks for your reply, but I can't use your solution.

I use a program that saves multiple images and the caption varies for each image.

 

Your solution is good to have an annotation just for one image but for multiple images, the annotation cannot be replaced when I capture another screenshot of the graph.

 

Thanks,

Fabien

0 Kudos
Message 5 of 6
(2,500 Views)

Hello,

 

I forgot to say by right clicking on the graph, then property, you can select sub title visible and you can write the caption in the sub title. It works perfectly.

 

Thanks for your help.

 

0 Kudos
Message 6 of 6
(2,441 Views)