I have a program that displays sensor data. At the beginning the sensor needs some time until it is in full operation. Therefore the sensor data starts at zero and then raises to e.g. 10. Then real measurements can start. The range of the interesting data is therefore in the range 10 - e.g. 20.
Therefore i implemented chart scrolling by setting a logical extent to the e.g. last 5 minutes.
The y-axis has and also should have the whole time the feature to auto-scale the range. At the moment when showing the full chart, this means the y-range us automatically 0 - 20, but since only the last 5 min are shown, the range should be 10 - 20 or whatever the y-data in this x-range is.
I could scan all data line series to find the min/max in the last 5 min and then set the axis min/max accordingly. But maybe there is a better solution?