LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

edit Graph label during runtime

Hi,

Is it possible to edit the label of the Graph during runtime? I know there is a property node to change the name, but I want to edit it by clicking on it, just like I can change the range of the scale.

 

Thanks,

Ritesh

0 Kudos
Message 1 of 10
(3,488 Views)

No you cannot change the label value of any control or indicator during the run time (I would be glad to know the reason "Why")

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 10
(3,484 Views)

You cannot change the label at run-time.  It is part of the definition of the VI and is compiled into the VI.

You can change the caption at run-time, but it would be programmatically.  You aren't going to be able to change the caption by just clicking on it and typing.

 

What you can do is hide both the label and the caption.  Put a string control in its place and give it the appearance of a label with a transparent background and border.  (You may need a classic string control to do this.)  Now you will be able to click on it and type in a new label.

Message 3 of 10
(3,477 Views)

I want to give user the flexibility of changing the label name just by typing it there. They can change the range of the markers just by clicking on it and expect the same behaviour of the label.

 

I can use the string instead of the default axes label, but then I'll have to deal with the resoulution stuff because the user can show/hide the axes, resize the graph. The user can also print the graph, so I will also have to program attaching string in the pint graph.

I don't think all that effort will worth the feature. 

 

Thanks!

0 Kudos
Message 4 of 10
(3,465 Views)

How do you have the user resizing the graph?  I have never seen that capability built into the graph before.

 

You were talking about the graph label, which to me meant the label that shows above the graph.  But now you are talking about an axis label, which is a different entity altogether.

 

An axis label can be programmatically changed, but can't be changed by a user clicking on a graph during run time.  I question why you would want to give a user of your program the ability to do that anyway.  The axis labels should be determined by the programmer since they are directly related to the data that is being displayed on the graph.  Giving the user the ability to edit a graph label could be dangerous as it could give the impression that the graph is displaying some completely different data set than it actually is.

0 Kudos
Message 5 of 10
(3,454 Views)

Yes I agree with Ravens Fan

 

If you still want to change the axis label means Enable the Scale legend so there you have the field for the label you can type in at any time to change it but not directly clicking the label.

-----

The best solution is the one you find it by yourself
Message 6 of 10
(3,446 Views)

 I know about the Scale legend. That's how I used to do it before I thought of adding all the features of scale legend on run time menu and get rid of the the scale legend.

 

I agree the axes label is a sensitive field, but the customers want to change it according to their naming conventions.

User can resize the application window and the graph resizes with the window.

0 Kudos
Message 7 of 10
(3,436 Views)

@LVCoder wrote:

 

User can resize the application window and the graph resizes with the window.



Okay, that makes sense.  The auto-scaling that comes with size with windows.  I never use that feature because I see it ultimately causing problems due to rounding when you rescale larger than smaller frequently.  The window never looks quite right again unless you shutdown the VI and reload it.

0 Kudos
Message 8 of 10
(3,434 Views)

Ravens Fan wrote:

 

The window never looks quite right again unless you shutdown the VI and reload it.



Even I don't like that feature, but I cannot go against the wish of the customer.

0 Kudos
Message 9 of 10
(3,431 Views)

Hi

 

may be you could provide string controls for the user to enter into, for axis labels. you can inherently use the property nodes to change the axis lables when a value change event on the above said string controls is detected.

 

i would do that if my customer wants to label the Y axis channels before taking a report. in this way, you will not have to pass the string value before takign the report. also, you will not have to worry about the font size when scalign the graph.

 

instead of scaling the graph size each time, design your GUI so that the graph gets maximum space. if you are showing legends along with the graph, their positions may be affected on repeated scaling of graph size.

 

 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 10 of 10
(3,410 Views)