LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
thesnarfman

Autoscale Only When Go Outside Scale Range

Status: New

Want to have graph display a certain scale unless values go outside scale min or max and then do autoscale but only in direction which scale bounds were crossed.

Example:
Normally want graph to display X scale 0 to 10 to display to user:
Scale 0 to 10 look good.PNG
If set same graph to autoscale would get the following graph that user could interpret as values are swinging all over the place but this could just be noise and I do not want to display this format to user:
Autoscale Bad.PNG
So I want a solution that incorporates manual scale and autoscale by autoscaling only after scale limit is exceeded. Asume get a data point of 13 which is above the max scale range of 10, graph would do a single autoscale only in direction above 10 to change max to 13.
Desired Result.PNG
Would be Graph Scales property. Option disabled if Autoscale was selected.
Properties.png

I know can use property nodes to programatically do this in my program but it is much more involved having to constantly check to see if values have gone outside range and then issue a single Autoscale.

15 Comments
ZX81
Member

I think Intaris (9/17, 6:39AM) hit the best solution, for both NI to implement, and for us to get all the options we want without re-writing it every time:  we write a .vi, and register it with the graph, chart, XY, or whatever.  The .vi would need to match a required connector pane.  I'd vote for one connector pane for any kind of indicator, but would live with a different connector pane for each type of indicator.  

 

I can't really decide if the callback should be bound to each scale or one callback for all scales.  And should the callback return ranges, or use property nodes to change them.

 

I do think the callback should be passed an array of clusters; each element would have <min X> <max X> <min Y> <max Y> for one plot.  It should also be passed a reference to the indicator, and an enum to specify which type it is (for making generic scale tools).  And of course, error in/error out.

 

IMO, the callback should be (at least able to be) re-intrant; clone for each instance.  That way, it's easier for us to remember the previous scale, etc.  But that isn't required.

 

For example, the caller would have:   Graph Scale 1.png, and the callback could be:  Graph Scale 2.png

 

(I'm sure no one would do exactly this, but I wanted to show it could fix the original request, and square up XY graphs, in the same solution)

___________________
CLD, CPI; User since rev 8.6.
Yamaeda
Proven Zealot

So you're suggesting a "preferred scale"? Or a minimum scale. I like it.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
ZX81
Member

I forgot about a hackish solution I used once.  It doesn't work for every case, but may help sometimes.

 

Add one or more signals to the chart/graph/XY that is the same color as the background, and does nothing more than make sure the scale keeps it visible.  For example, when I have a signal TEMP, and want to make sure the scale doesn't show 1/1000ths of a degree, I could graph TEMP [red], TEMP+2 [white], and TEMP-2 [white].  The white signals can also be configured to have no lines and only single-point dots.  Otherwise, the white line covers over the grid lines of the chart.

 

I don't have time to find where I did similar, or to replicate it, but I think if I made the signals invisible, they were also ignored for the autoscaling.  If you add 2 or more signals for this, you can fill between them.  I think (but don't remember for certain) that the grid lines are on top of fills.

 

To always include 0 and 100, I could also graph TEMP [red], 0 [white], and 100 [white].  (also needing to make sure the grid lines aren't hidden.

 

A major down-side (and why I don't do this often) is  that the signals for the hack show up on the displayed list.

 

 

___________________
CLD, CPI; User since rev 8.6.
Henrik_Volkers
Trusted Enthusiast

Just my adds to the autoscale wish list:

 

 

The autoscale post processing vi idea. Great would be a documentation on how the autoscale is done. I assume some metrics like in the TEX typesetting,

and finally some read access to these metrics ..

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Gustep12
Member

I actually found a solution that is simple and intuitive: We just have to add one or two "invisible" plot traces, which describe the desired max and min Y-range of the chart.

 

The key is to keep the "Visible" property set to TRUE, otherwise the autoscaling will ignore the trace. So we need to make the trace invisible by other means, namely by giving it a "no dot marker" and "no line" property as follows:

 

 

How to add an invisible plot trace, which is still visible to the autoscalerHow to add an invisible plot trace, which is still visible to the autoscaler