ChartDirector 7.1 (C++ Edition)

ViewPortManager.zoomAround


Usage

bool zoomAround(double x, double y, double xZoomRatio, double yZoomRatio);

Description

Zooms around a certain point.

This method adjusts the viewport position and size to reflect zooming in/out around the given point. If possible, the given point not move (that is, stays at the same x and y coordinates) after zooming in/out.

Arguments

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