LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph X Scale Change - Maximum and Minimum Only

Hello everyone

 

I have a XY graph with these settings for the X scale:

 

Marker spacing: uniform

Style: numbers and ticks along the whole axis

Mapping: linear

Autoscale: off

 

As soon as the data reaches the graph, a SubVI sets the X scale (that's why I am not using autoscale).

 

Let's think about this X scale:

 

0

5

10

15

20

25

30

35

40

45

50

 

I want to keep all the middle values (and ticks) visible on the X scale, but I want to add some code to allow the user change ONLY the first (minimum) and the last (maximum) values, by typing a new value over it using the keyboard. If the user try to change any of the middle values (5, 10, 15, 20, 25, 30, 35, 40, 45, 50), the code should discard that and not change the scale.

 

If the user changes minimum or maximum by tyoing new values, and because of that the middle values change, it's not a problem because they are changing to adjust to the new range. What I want is prevent the user from typing new values and changing the middle values by him/her self.

 

Thanks

 

Dan07

0 Kudos
Message 1 of 3
(3,660 Views)

My first idea was:

 

After the event is triggered by "scale range change", I can verify if "minimum" and "maximum" have changed or not, as compared to values before this event. If "minimum" and "maximum" are unchanged, what triggered this event was a change in the middle values and I can discard this event and don't allow this event to change the scale.

 

What do you guys think about that?

0 Kudos
Message 2 of 3
(3,656 Views)

There's a way that's way easier than this: create a decoration that is transparent, and make it just large enough to cover the middle values. The user can "click on the middle range values" to try to change the value, but the click is actually landing on the inert decoration whose Z-order is higher than the graph.

 

If the FP is not going to undergo many design revisions, perhaps it is enough to follow my above example. A more complex method could be attained by using a transparent Classic Simple String, with run-time property nodes to set it's size and location to ensure it's hiding the scale correctly. 

0 Kudos
Message 3 of 3
(3,629 Views)