LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change scale legend programatically?

Is there any way to change the scale legend programattically? I have a graph with two plots and two y-scales. I won't know if the second plot refers to the first or second scale until run-time. I'd like to adjust the scale legend appropriately. I can hide the scale on the graph and associate the plots with the correct scales. I cannot, however, find any way to turn off the display of the second scale in the scale legend. The only thing I can seem to do is turn the visibility of the scale legend on or off entirely.
0 Kudos
Message 1 of 6
(3,074 Views)

You can programmatically modify the scale legend, some properties in LV 6 and 7, however in 8, most of that functionality was taken out. Now you can only choose to show all of the legend or none of it, you can do this programmatically, but there is not a function to let you control only some legends at a time.

 

Regards,

Andrew

National Instruments
RIO Embedded Hardware PSE

CompactRIO Developers Guide
0 Kudos
Message 2 of 6
(3,040 Views)

Hi,

(Ten Years After)

 

I'm using LabVIEW 2017. The Help says:

WFM Graph Properties.jpg

"For example, if you want to modify the scale label, right-click the string element in the scale legend and create a Property Node for that element."

 

Is this true or not?

 

I have one small wish : to change the number of visible elements in scale legend array. Programmatically, of course.

 

Regards, 

Ljubo.

0 Kudos
Message 3 of 6
(2,309 Views)

Hi Ljubo,

 


@Ljubo wrote:

I have one small wish : to change the number of visible elements in scale legend array. Programmatically, of course.


When there is more than one scale you need to set the ActiveScale (using an ActiveScale property) before changing its properties…

(Your question is not very clear: do you want to change the scale label or do you want to switch its visibility?)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(2,306 Views)

Hi!

 

Thank you for your fast response.

 

To clearify : I have one question and one wish.

1.The question : is it possible (LabVIEW Help says so!) that I can create a property node for string element in the scale legend? I can't or I don't know how to do it. Right-click on the string element does not give me any possibility to do it.

string element.jpg

2. The wish : I would like to change the number of visible elements in the scale legend array.

Scale legend arrays.jpg

 I know how to show or hide the second axis and set its properties, but I do not know how to show or hide the third element in the scale legend.

 

Regards, 

Ljubo.

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

Hi Ljubo,

 


@Ljubo wrote:

To clearify : I have one question and one wish.

1.The question : is it possible (LabVIEW Help says so!) that I can create a property node for string element in the scale legend? I can't or I don't know how to do it. Right-click on the string element does not give me any possibility to do it.

2. The wish : I would like to change the number of visible elements in the scale legend array.

 I know how to show or hide the second axis and set its properties, but I do not know how to show or hide the third element in the scale legend.


  1. I also didn't found a way to create a property node from right-clicking the scale legend. Surely a "typo" in the LabVIEW help.
  2. I also didn't found a way to set the number of entries in the scale legend (in contrast to the plot legend, where you can limit the number of visible entries).

(Tested with LV2017.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 6
(2,295 Views)