LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zooming to part of an intensity graph?

Solved!
Go to solution

I have an intensity graph on which the y axis represents discrete channels. I want to be able to zoom the chart so that there are an integer number of channels displayed. The default behaviour seems to be that when you xoom, it is possible to see half channels on the plot. What I'd love to have is a situation where if the zoomed range on the Y axis was showing for example channel 22.7 to channel 28.1, that the plot would resize the Y axis to the range 23 to 28. I'd also want to be sure that a minimum of one channel were displayed. I see no obvious easy way of doing it, but I'd love to be wrong........

 

Thanks for any help,

 

Joe

0 Kudos
Message 1 of 4
(2,842 Views)
Solution
Accepted by topic author Joe_McC

You mention intensity graph and chart interchangeably. Since they are quite different, could you clarify what you actually have?

 

Personally, I would use integer numeric controls to set the xmin and xmax. You can do math and range checking as needed.

 

Alternatively, there is also a "Scale range change" event, that you could use to edit the ranges after the user has zoomed.

Message 2 of 4
(2,831 Views)

Sorry, I should have been clearer. It is an intensity graph.

 

I'll take a look at what you suggest.

 

Thanks,

 

joe

0 Kudos
Message 3 of 4
(2,808 Views)

The 'Scale range change' event did the trick. In the case for that event you read the Y scale max, round towards +infinity & write it back. Then with the Y scale min, round towards -infinity & write that back. Thanks for the hint!

 

Joe

0 Kudos
Message 4 of 4
(2,794 Views)