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.
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.
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?
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.
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.