Zoom


Introduction

Zooming a display involves the enlargement of a selected part of the data being viewed. A simple zoom may be achieved through the use of Xwindow resizing facilities. In some cases this will be sufficient for the user's needs. In other cases the user will require more control over the process in order to get a more detailed or clearer view of a portion of the data or to maintain window size requirements.

The Chart library facilitates the creation of zoom applications by providing the XmNareaSelectionCallback resource and the XintChartZoom convenience function. They enable the application designer to change the data displayed in the viewport easily.

In the figure shown below, a subset of the data between 1993 and 2003 has been zoomed from the background plot to fill the viewport in the foreground plot. The code which produced this display follows a discussion of the viewport.



Figure 21: Chart Zoom Example.


Data Viewport

The data viewport is the visible area of the plot. The plot area is controlled by the data range of the plot object as specified by the XmNxLimits and XmNyLimits resources of the Plot2D and Plot3D Object Metaclasses (Plot3D also has an XmNzLimits resource). These resources are pointers to type XintLimits, a structure which contains the minimum and maximum data values for the given axis.

If XintLimits is NULL, autoranging is performed and the minimum and maximum data values will be used. Either raw data values or rounded data values can be selected through the use of the XmNxAutoRange and XmNyAutoRange resources. Autoranging of a single parameter in the XintLimits structure may be achieved by setting it to XintUNDEFINED_FLOAT. The following code segments illustrate these capabilities.