Overview
This VI programmatically changes the number of displayed data points on a Chart.
Description
This VI uses an Event Structure and the XScale Property Nodes of a Chart to change the number of displayed data points on a Chart.
It also generates data periodically to update the Chart.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
Note that the Data Entry for the Data Points Control has been set to coerce all input data to a value between 0 and 1024.
The value 1024 was chosen because this is the default Chart History Length of a Chart. Therefore, you cannot display more Data Points than the number of data points available in your Chart History.
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This doesn't work on my computer (using LV 8.6). Nothing changes when I set a new value for the data points. The marker value is changed, though. What could be the reason?
Nothing changes for me as well. I am on LV7.1
This indeed doesn't work at all. I found the way to do it was just to change the XScale.Maximum to the number of points acquired so far minus 1 and XScale.Minimum to that minus the number of points you want to display.
National, please update this page to reflect that because your example doesn't work.
I've found that you don't even need to read the max value. Simply put in 0 for the min and whatever range you want for the max value and the chart will automatically adjust to have that range on what it displays showing the most current data. Even if you are writing to the chart at the time.
Does not work at all. Tried with LV2013.