LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fix axes in intensity graph with cursor

Hi all,

I try to use the intensity graph as an xy-input device. The user should be allowed to drag the cursor to enter the value. However, the user can always move the cursor outside the plot area, which causes the corresponding axis to rescale. I want to have strictly fixed upper and lower limits. Is there any way to achieve this? One possible solution would be to reset the min/max values every time the cursor was moved (and coerce the cursor position back into the range). A simpler approach would be appreciated!

Regards,
Matthias
0 Kudos
Message 1 of 8
(3,809 Views)
Disable the autoscale for both X and Y axies, when cursor position goes outside, rescale the scales one time (using VI property).

-Joe
0 Kudos
Message 2 of 8
(3,809 Views)
Hi Matthias,
You've got 2 solutions. One on the front panel, one dynamically.
On the front panel, right click on your intensity graph -> Properties -> Scales -> no auto scale for X, no-auto scale for Y and your intensity graphs won't scale automatically anymore.
On the diagram, create a property node of your intensity graph and put a 0 for the properties ScaleX -> Auto adjust and ScaleY -> Auto-adjust.
These two operations have the same effect on the auto scaling of the graph.
Try and do the same operation for Z axis and see what happens.

Hope this helps !
Julien
0 Kudos
Message 3 of 8
(3,809 Views)
Hi,

thank you for your answer. Autoscale has always been turned off for both scales.

The problem is not the scales being rescaled due to data, but due to cursor movement. This does not seem to be affected by the Autoscale properties.

Matthias
0 Kudos
Message 4 of 8
(3,809 Views)
> I try to use the intensity graph as an xy-input device. The user
> should be allowed to drag the cursor to enter the value. However, the
> user can always move the cursor outside the plot area, which causes
> the corresponding axis to rescale. I want to have strictly fixed upper
> and lower limits. Is there any way to achieve this? One possible
> solution would be to reset the min/max values every time the cursor
> was moved (and coerce the cursor position back into the range). A
> simpler approach would be appreciated!
>

You don't say what version of LV you are using, but if it is relatively
recent, right click on the graph and go to Advanced and uncheck the
option to have Cursors Scroll Graph. The user can still drag and
release the cursor und
er the edge of the graph, but this will not change
the scales. You can pretty easily filter cursor points that are out of
range and even write back to the cursor value if you need to. I believe
that if there is data in the plot and the cursor is set to lock to the
plot, then it cannot be dragged outside the data either, and that is
another solution.

Greg McKaskle
Message 5 of 8
(3,809 Views)
Hi,

thanks, that hint at least reduced the effort as I don't have to set the scale min/max values every time.

Regards
Matthias
0 Kudos
Message 6 of 8
(3,809 Views)
Hello Matthias,

did you solve the problem?
0 Kudos
Message 7 of 8
(3,809 Views)
Hi,

yes: Gregs comment was right, setting that property keeps the axes fixed. However, it is possible, to drop the cursor outside the visible area. So I check every time and move the cursor back to the border of the allowed area, when it is outside.

Regards
Matthias
0 Kudos
Message 8 of 8
(3,809 Views)