Updates the full range of a horizontal viewport data scale.
This method can be called to modify an existing full range (see
WPFChartViewer.setFullRange). When the full range is modified, there are several ways to update the viewport. This is best explain by using an example.
Suppose in a real-time chart, the full range is 200 seconds, and the viewport is viewing the last 50% of the data. In viewport coordinates, it is viewing from 0.5 to 1.0 of the full range. In axis scale, it is viewing the last 100 seconds of data from time = 100 to 200. Suppose new data comes in and the full range is updated to 300 seconds. The viewport can be updated in the following ways:
- The viewport coordinates can remain unchanged, that is, it is still viewing 0.5 to 1.0 of the full range. In axis scale, it would become time = 150 to 300. This update type is represented by the constant ViewPortNoUpdate.
- The viewport can be adjusted so that the axis scale remain unchanged from time = 100 to 200. In other words, the visible display will remain unchanged. This update type is represented by the constant KeepVisibleRange.
- The viewport can be adjusted so that the it is still viewing the last 100 seconds of data, which would be time = 200 to 300. This update type is represented by the constant ScrollWithMax, because as new data are added, the chart will appear to scroll to keep the latest data visible.
- For completeness, there is an additional update type ScrollWithMin, which will be useful if the new data is appended on the lower side of the full range.
Sometimes it is impossible to adjust viewport using the specified method. For example, for real-time charts, some systems will automatically remove old data to avoid unlimited data accumulation. The
KeepVisibleRange can become impossible if the visible range was removed. In this case, ChartDirector will adjust the viewport to keep it within the valid range.
© 2023 Advanced Software Engineering Limited. All rights reserved.