ChartDirector Ver 4.1 (C++ Edition)

ViewPortManager.zoomAt


Usage

bool zoomAt(int zoomDirection, int x, int y, double zoomRatio);

Description

Zooms in/out around a certain point.

This method adjusts the view port position and size to reflect zooming in/out around the given point. If possible, the given point will be at the center of the view port after zooming in/out.

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.
x(Mandatory)The x-coordinate of the point to zoom around.
y(Mandatory)The y-coordinate of the point to zoom around.
zoomRatio(Mandatory)The zoom magnification factor. For example, a value of 2 means zooming in by 2x. A value of 0.5 means zooming out by 2x.

Return Value

True if view port is changed, otherwise false. It is possible for no zooming to occur if zoom limits are reached. See ViewPortManager.setZoomInWidthLimit, ViewPortManager.setZoomOutWidthLimit, ViewPortManager.setZoomInHeightLimit and ViewPortManager.setZoomOutHeightLimit for the meaning of zoom limits.