ChartDirector 7.1 (C++ Edition)

ViewPortManager.zoomTo


Usage

bool zoomTo(int zoomDirection, double x1, double y1, double x2, double y2);

Description

Zooms to the selected rectangular region.

This method updates the viewport position and size to reflect a rectangular region on the chart. (x1, y1) and (x2, y2) are opposite vertices of the rectangular region in pixel coordinates.

The final viewport position may not exactly reflect the rectangular region because of zoom limits. See ViewPortManager.setZoomInWidthLimit, ViewPortManager.setZoomOutWidthLimit, ViewPortManager.setZoomInHeightLimit and ViewPortManager.setZoomOutHeightLimit for the meaning of zoom limits.

Arguments

ArgumentDefaultDescription
zoomDirection(Mandatory)The allowed zoom direction. Must be one of the predefined constants DirectionHorizontal, DirectionVertical and DirectionHorizontalVertical for horizontal, vertical and bi-directional zooming.
x1(Mandatory)The x-coordinate of one vertices of the selected rectangular region.
y1(Mandatory)The y-coordinate of one vertices of the selected rectangular region.
x2(Mandatory)The x-coordinate of the vertex that is opposite to the vertex (x1, y1).
y2(Mandatory)The y-coordinate of the vertex that is opposite to the vertex (x1, y1).

Return Value

True if viewport is changed, otherwise false.