LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Horizontal scrollbar of waveform chart in tab page resets to end when tab page switched

I've got a VI in LV 2012 with a chart in one of two pages of a tab control.  Whether compiled to an executable or not, when the waveform chart contains data that is no longer being updated and the x-axis range doesn't show the last point of data, the horizontal scroll bar auto-adjusts to show that last point if you switch pages (back to the chart) on the tab control.  I've tried turning off Autoscaling but that doesn't stop the effect. 

 

Additional issues: 

  1. On some of these attempts at reproducing this, the X-Axis will even change scaling, zooming in on the data.
  2. When data is pushed left by this bug to allow displaying the furthest data point, if the leftmost area of the chart was blank before the data was pushed left, the data pushed left into the formerly blank area will not be displayed.  This happened only when the X-Axis was manually autoscaled prior to pushing the data off the right edge of the chart, and only if the x-axis scale was not changed.  If the tab pages are again switched at this point away and back to the chart, the data re-appears.

 

The chart is a stacked plot if that makes a difference,  Also, the tab control is not linked to any event handlers.

 

Also, the scrollbar works fine if you scroll such that the rightmost data points are on the chart along with blank area to the right, whether there is more data off the left edge of the chart or not.

 

Last, the Y-Axis of each stacked plot is unaffected by any of this.

 

I hope this isn't a duplicate - I didn't find it in the forums.

 

Thanks,

Erik

 

Message 1 of 16
(5,903 Views)

I am looking into whether the behavior of the Waveform Chart in the Tab Control is an expected behavior or not. The errors are not expected but the behavior of the chart may be due to the Tab Control reloading when the tab is switched. You could work around the issue by writing a vi to save the state data (horizontal scroll position) when you switch out of the tab and then reload the data when you switch back to that tab.  

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 2 of 16
(5,874 Views)

Alex,

 

That does seem to solve it.  Unfortunately, while playing with my new VI, I found more charting issues:

 

1.  If anychart elements are set to Autoscale (Autoscale Lock is enabled in the scale legend), pressing the AutoScale Once button for one plot causes these other plots to auto-range.

2.  If none of the chart elements are set to Autoscale in the scale legend, pressing the Autoscale Once button for the X-Axis has no effect if the x-axis was previously set to show all the data history but then panned such that some data falls of either side of the chart.

2.  The Y-Axis will also auto-scale when returning to the Chart tab (if Autoscale is enabled for the plot) with the fix for the x-axis scale in place (restoring the Xscale.Range parameters from a local variable).

3.  Pressing the "Scale" button on one of the plots causes the X-Axis scale to be lost - this happens inconsistently though.  It looks like it set the X-Axis to the same problem range as before the fix was in place.

 

I love the power of LabVIEW's charts, but the bugs in stacked plot waveform charts appear to be numerous.

 

I've attached my modified VI for you to confirm these issues (again, assuming they're not behaving as intended).

 

Thanks,

Erik

0 Kudos
Message 3 of 16
(5,864 Views)

For number 1 I found this in this help document: When a graph or chart scale resizes, other elements on the graph or chart move and resize. To disable this behavior so the plot area size stays fixed, right-click the graph or chart and select Advanced»Auto Adjust Scales from the shortcut menu. If you disable this behavior, the scales might clip or overlap each other. You can read the full document here: https://www.ni.com/docs/en-US/bundle/labview/page/customizing-graphs-and-charts.html

 

For number 2 I am not able to reproduce this with your code. The Autoscale button returned the scales to the full range as its supposed to. 

 

For number 3 Do the same as you did for the Xscale Range for the Yscale Range. I have made inquiries about the scale resetting problem and will let you know when I know more. 

 

For number 4 Are you refering to the Scale Format button? The second button in the Scale Legend is the Autoscale button. I just want to make sure as I don't see a Scale button. If you are pressing the Autoscale button then that explains the behavior. I don't think you are but make sure. Take a look at this page to make sure we are talking about the same thing: https://www.ni.com/docs/en-US/bundle/labview/page/using-scale-legends.html

 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 4 of 16
(5,854 Views)

Alex,

 

Thanks for the quick response on this.  Again, the charts are awesome except for these minor fiddling details.  Sorry about the terminology confusion - I didn't find anything in the Help system naming the legend buttons, and unfortunately I can't edit the prior post.  When I said "AutoScale LocK" I meant "Scale Lock", and "AutoScale Once" I meant "Autoscale".

 

Here are the issues, hopefully clarified:

1.  If any chart elements have Scale Lock set, pressing the AutoScale button for any plot causes these other plots to autoscale as well.  Note these are not plots with multiple Y scales, they're stacked plots with separate y-scales for each plot.  Changing the "Advanced->Auto Adjust Scales" parameter had no effect on this issue.

 

2.  If none of the chart elements have Scale Lock set in the scale legend, pressing the Autoscale button for the X-Axis has no effect if the x-axis was previously set to show all the data history but then panned such that some data falls of either side of the chart.

 

     This may have been confusing, so here's a breakdown of the steps to re-produce the problem using the VI I previously attached.

a.  AutoScale all elements of the chart, and turn off Scale Lock on all elements

b.  Move the data to the right in the chart, so the left half of the chart area has no data (e.g., set the X-Axis range to -5 to 6 seconds)

c.  Press the X-Axis AutoScale button.  The X-Axis range will not change from where it was in (b).

 

3.  The Y-Axis will also auto-scale when returning to the Chart tab if Scale Lock is enabled for the plot with the fix for the x-axis scale in place (restoring the Xscale.Range parameters from a local variable).  If the fix is not performed, this doesn't happen.

 

4.  Pressing the Scale Lock button on one of the plots causes the X-Axis scale to be lost IF there is data past the maximum displayed X-Axis range.  It looks like it set the X-Axis to the same problem range as before the fix was in place.  I don't know how to build an event case for this, except for possibly "Mousedown?".

 

One more:

 

5.  Enabling Scale Lock on any plot auto-scales any other plot that has Scale Lock enabled (assuming the user changed the Y-Axis range from the previously auto-scalled range).  Obviously this is linked to #1 above, but worth noting.

 

Thanks again, Alex!

 

Erik

0 Kudos
Message 5 of 16
(5,843 Views)

1. The scale lock does not prevent the scale from being effected from the Autoscale Button. It only turns off Autoscaling. 

 

2. I was not able to reproduce this on my example code that I used to verify the problem from earlier. 

 

3. This is probably just a symptom of the original problem with the adjustment of the position of the data and the use of the fix. 

 

4. Does the button change states from the Scale Lock on to off or off to on?

 

5. I will have to investigate this point further not sure exactly what is happening there. 

 

Have a good day. 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 6 of 16
(5,823 Views)

Alex,

 

Here's a vidcap of issue #2 using the VI I supplied.

 

RE #3 - why would the Y-Axis auto-scale when scaling the X-Axis?  It's definitely not desirable for this to happen.

 

RE #4 - from Off to ON. Let me know if you'd like a vid-cap of this as well.

 

Thanks,

Erik

0 Kudos
Message 7 of 16
(5,818 Views)

I have looked at the video and I think that the problem is present because the data in the graph is not being updated. When you take new data into a graph the auto scale button works fine.

 

The Lock Closed means that Auto Scaling is enabled and will effect the graph. The Y-Axis auto-scale should not effect the X-Axis. I have not see that behavior so far. I think this point also explains point 4. 

 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 8 of 16
(5,796 Views)

Alex,

 

Please forward these issues on to the dev team regardless of your opinion of they falling into the classification of "flaws" or not.  I consider them to be flaws and will continue to.  They should be easy to fix - far easier than the workarounds required to avoid them, especially since some can't be worked around.

 

Thanks,

Erik Ledding

0 Kudos
Message 9 of 16
(5,774 Views)

I can reproduce the BUG reported in the OP (in LV 2013) and would really like NI to acknowledge it and work towards fixing it.

A chart scrollbar jumping to the end of its range when you switch to another page? What the rationale of this behavior?

0 Kudos
Message 10 of 16
(5,575 Views)