ChartDirector 6.0 (C++ Edition)



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


Zooms at a certain point.

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


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 at.
y(Mandatory)The y-coordinate of the point to zoom at.
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 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.