08-07-2013 04:54 PM
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:
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
08-08-2013 04:14 PM
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.
08-09-2013 09:49 AM
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
08-09-2013
12:57 PM
- last edited on
04-30-2025
03:36 PM
by
Content Cleaner
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
08-09-2013 02:32 PM
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
08-12-2013 09:02 PM
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.
08-13-2013 10:46 AM
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
08-14-2013 05:01 PM
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.
08-19-2013 01:00 PM
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
04-22-2014 08:07 PM - edited 04-22-2014 08:08 PM
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?