12-10-2011 09:22 AM
Hi all,
having applied due diligence by parsing the context help, labviewwiki and these fine forums, I couldn't find a hint on how to achieve this:
I would like tor restrict the scaling of only the Y-axis of an XY graph. Or, to put it in other words, I want the user to be able to zoom in and scroll through a signal only in the time domain, the value domain should stay fixed to a min/max pair - let's assume 0-100% for simplicity. Ideally, I would like to use the graph palette for that.
Here's what I tried, with the outcome
- disable Range => Y Scale: no such property
- catch the event "Scale Range Changed" and set the scale to a fixed value => flickering, the property can only be changed AFTER the GUI has already redrawn it
- modify the graph palette by customizing the control => not possible
- set the state to disabled => the graph palette doesn't work anymore
Thanks for any input. I hope I'm missing something really basic here.
Solved! Go to Solution.
12-10-2011 09:28 AM
One of the best methods here is to build your own graph palette. Then you can use only those functions that you want. You link the new buttons you create through the graph property node Palette>>Active Tool.
Your new button(s) would set the mode to these properties:
0 = Selection Cursor
1 = Panning Tool
2 – 7 = Zoom Tools
2 = Window Zoom
3 = Horizontal Zoom
4 = Vertical Zoom
5 = Show Full
6 = Zoom In
7 = Zoom Out
Use the Horizontal zoom only and you will have what you need.
Rob
12-10-2011 09:44 AM
Hey Rob,
thanks for the reply. The idea is sweet, I gave a quick try. It does indeed work for zooming in horizontally, yet pan and zoom-to-fit still change the Y axis. Any idea how Y can be locked at least for panning?
Cheers!
12-10-2011 10:31 AM
I don't see an easy way to lock down the pan function. You can set the minimum and maximum, but - as you said earlier - you get a jumpy (blinking) graph. Even if the update rate is very high.
If I (or anyone else) comes up with something, we will let you know.
Outside of using an ActiveX (a 2D ActiveX graph) or .Net component - they have their own unique issues. That may be a possibility though.
Rob
12-10-2011 10:59 AM
Thanks Rob - at least I now know that I'm not missing something obvious.
As I see it at the moment the best bet would be to not use the graph palette but instead create a custom 'tool' that overrides the mouse handler when active and does the panning manually by adjusting the X Scale Minimum and Maximum values symmetrically.
Thanks again.
z