Platforms to show: All Mac Windows Linux Cross-Platform

Back to CDViewPortManagerMBS class.

CDViewPortManagerMBS.canZoomIn(zoomDirection as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if it is possible to zoom in further at a certain direction without violating zoom in limits.

See ViewPortManager.setZoomInWidthLimit and ViewPortManager.setZoomInHeightLimit on how to configure zoom in limits.
ArgumentDefaultDescription
zoomDirection(Mandatory)The zoom direction to check. Must be one of the predefined constants DirectionHorizontal, DirectionVertical and DirectionHorizontalVertical for horizontal, vertical and bi-directional zooming.
Return Value
True if can zoom in further, otherwise false.

CDViewPortManagerMBS.canZoomOut(zoomDirection as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Checks if it is possible to zoom out further at a certain direction without violating zoom out limits.

See ViewPortManager.setZoomOutWidthLimit and ViewPortManager.setZoomOutHeightLimit on how to configure zoom out limits.
ArgumentDefaultDescription
zoomDirection(Mandatory)The zoom direction to check. Must be one of the predefined constants DirectionHorizontal, DirectionVertical and DirectionHorizontalVertical for horizontal, vertical and bi-directional zooming.
Return Value
True if can zoom out further, otherwise false.

CDViewPortManagerMBS.clearAllRanges

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A convenience method to clear all the ranges configured using setFullRange.

Some examples using this method:

CDViewPortManagerMBS.commitPendingSyncAxis(baseChart as CDBaseChartMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The commitPendingSyncAxis is a method to actually perform the function in syncLinearAxisWithViewPort, syncLogAxisWithViewPort and syncDateAxisWithViewPort.

Some examples using this method:

CDViewPortManagerMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a new viewport.

CDViewPortManagerMBS.dragTo(scrollDirection as integer, x as double, y as double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Scrolls the view port to reflect dragging of the underlying rectangular surface.

The amount of drag is measured as changed in mouse cursor coordinates since the call to ViewPortManager.startDrag. A positive change means the dragging is to the right or bottom. A negative change means the dragging is to the left or top.

The drag is considered as applying to the underlying surface. The view port moves in the opposite direction to the drag. For example, dragging the underlying surface to the right is equivalent to moving the view port to the left.

The view port may not change at all if it has reached the borders of the underlying surface.
ArgumentDefaultDescription
scrollDirection(Mandatory)The allowed scroll direction. Must be one of the predefined constants DirectionHorizontal, DirectionVertical and DirectionHorizontalVertical for horizontal, vertical and bi-directional scrolling.
deltaX(Mandatory)The change in mouse x-coordinates. A positive change means the drag is to the right. A negative change means the drag is to the right.
deltaY(Mandatory)The change in mouse y-coordinates. A positive change means the drag is to the bottom. A negative change means the drag is to the top.

Some examples using this method:

CDViewPortManagerMBS.inExtendedPlotArea(x as Integer, y as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 12.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Determines if a given (x, y) coordinate is within the extended plot area (the plot area plus the extra margin sets up using setPlotAreaMouseMargin).

Some examples using this method:

CDViewPortManagerMBS.inPlotArea(x as double, y as double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Determines if a given point is within the plot area.

ArgumentDefaultDescription
x(Mandatory)The x coordinate of the point in pixel unit.
y(Mandatory)The y coordinate of the point in pixel unit.
Return Value
True if the point is within the plot area, otherwise false.

Some examples using this method:

CDViewPortManagerMBS.updateFullRangeH(id as string, minValue as Double, maxValue as Double, updateType as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Updates the full range of a horizontal viewport data scale.

ArgumentDefaultDescription
id(Mandatory)The name of the horizontal data scale.
minValue(Mandatory)The new minimum value of the data scale.
maxValue(Mandatory)The new maximum value of the data scale.
updateType(Mandatory)The method to update the viewport. Must be one of ViewPortNoUpdate, KeepVisibleRange, ScrollWithMax or ScrollWithMin.

Some examples using this method:

CDViewPortManagerMBS.updateFullRangeV(id as string, minValue as Double, maxValue as Double, updateType as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Updates the full range of a vertical viewport data scale.

ArgumentDefaultDescription
id(Mandatory)The name of the vertical data scale.
minValue(Mandatory)The new minimum value of the data scale.
maxValue(Mandatory)The new maximum value of the data scale.
updateType(Mandatory)The method to update the viewport. Must be one of ViewPortNoUpdate, KeepVisibleRange, ScrollWithMax or ScrollWithMin.

Some examples using this method:

CDViewPortManagerMBS.validateViewPort

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Ensures the view port left, top, width and height are within valid ranges and adjusts them if necessary.

The valid ranges of the view port width and height should be 0 to 1. The view port left should be in between 0 and (1 - view port width). The view port top should be in between 0 and (1 - view port height).

Some examples using this method:

CDViewPortManagerMBS.zoomAround(x as double, y as double, xZoomRatio as double, yZoomRatio as double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 15.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Zoom at a given point using the zoom ratio.

Some examples using this method:

CDViewPortManagerMBS.zoomAt(zoomDirection as integer, x as double, y as double, zoomRatio as double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
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.
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.

Some examples using this method:

CDViewPortManagerMBS.zoomTo(zoomDirection as integer, x1 as double, y1 as double, x2 as double, y2 as double) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method ChartDirector MBS ChartDirector Plugin 8.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Zooms to the selected rectangular region.

This method updates the view port 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 view port 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.
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 view port is changed, otherwise false.

Some examples using this method:

The items on this page are in the following plugins: MBS ChartDirector Plugin.


The biggest plugin in space...