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 |
See ViewPortManager.setZoomInWidthLimit and ViewPortManager.setZoomInHeightLimit on how to configure zoom in limits.
Argument | Default | Description |
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. |
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 |
See ViewPortManager.setZoomOutWidthLimit and ViewPortManager.setZoomOutHeightLimit on how to configure zoom out limits.
Argument | Default | Description |
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. |
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 |
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 |
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 |
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 |
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.
Argument | Default | Description |
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:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.getPlotAreaHeight as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Return Value
The height of the plot area in pixels.
Some examples using this method:
CDViewPortManagerMBS.getPlotAreaLeft as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Return Value
The x-coordinate of the left side of the plot area in pixels.
Some examples using this method:
CDViewPortManagerMBS.getPlotAreaTop as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
CDViewPortManagerMBS.getPlotAreaWidth as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
CDViewPortManagerMBS.getValueAtViewPort(id as string, ratio as Double, isLogScale as boolean = false) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please refer to ViewPortManager.setFullRange on how to define a data scale.
Argument | Default | Description |
id | (Mandatory) | The name of the data scale. |
vpCoor | (Mandatory) | The view port coordinate. |
isLogScale | false | true if the conversion is based on a logarithmic scale. false if the conversion is based on a non-logarithmic scale. |
Returns the value of the specified data scale at the view port coordinate.
Some examples using this method:
CDViewPortManagerMBS.getViewPortAtValue(id as string, ratio as Double, isLogScale as boolean = false) as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Please refer to ViewPortManager.setFullRange on how to define a data scale.
Argument | Default | Description |
id | (Mandatory) | The name of the data scale. |
value | (Mandatory) | The value to be converted. |
isLogScale | false | true if the conversion is based on a logarithmic scale. false if the conversion is based on a non-logarithmic scale. |
Returns the view port coordinate at the value of the specified data scale.
Some examples using this method:
CDViewPortManagerMBS.getViewPortHeight as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The view port height is expressed as a fraction of the height of the underlying surface. It should be between 0 and 1.
Some examples using this method:
CDViewPortManagerMBS.getViewPortLeft as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The position of the view port left side is its distance from the left side of the underlying surface, as a fraction of the width of the underlying surface. It should be between 0 and 1.
Some examples using this method:
CDViewPortManagerMBS.getViewPortTop as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The position of the view port top side is its distance from the top side of the underlying surface, as a fraction of the height of the underlying surface. It should be between 0 and 1.
Some examples using this method:
CDViewPortManagerMBS.getViewPortWidth as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The view port width is expressed as a fraction of the width of the underlying surface. It should be between 0 and 1.
Some examples using this method:
CDViewPortManagerMBS.getZoomInHeightLimit as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDViewPortManagerMBS.getZoomInWidthLimit as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDViewPortManagerMBS.getZoomOutHeightLimit as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDViewPortManagerMBS.getZoomOutWidthLimit as Double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
CDViewPortManagerMBS.getZoomXYRatio as double
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The ViewPortManager.setKeepAspectRatio can be used to keep the aspect ratio unchanged. This method gets that aspect ratio.
Returns the enforced aspect ratio, or 0 if the aspect ratio is not enforced.
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 |
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 |
Argument | Default | Description |
x | (Mandatory) | The x coordinate of the point in pixel unit. |
y | (Mandatory) | The y coordinate of the point in pixel unit. |
True if the point is within the plot area, otherwise false.
Some examples using this method:
CDViewPortManagerMBS.setChartMetrics(metrics as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Argument | Default | Description |
metrics | (Mandatory) | A text string obtained from BaseChart.getChartMetrics that represents the metrics of the chart. |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setFullRange(ID as string, minValue as Double, maxValue as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In the ChartDirector zooming and scrolling framework, the view port coordinates are expressed as the visible fractions of the "full data scale". For example, if the "full data scale" is 10 years horizontally, a view port width of 0.1 means that 1 year of data are visible.
The setFullRange method defines the full range of a data scale and gives it a name. As ChartDirector supports multiple x-axes and y-axes, so there can be multiple data scales with different names. The name can be used in other ChartDirector APIs to convert between the view port coordinates and data scale (see ViewPortManager.getValueAtViewPort, ViewPortManager.getViewPortAtValue), and to configure an Axis to reflect the visible data scale (see ViewPortManager.syncLinearAxisWithViewPort, ViewPortManager.syncLogAxisWithViewPort and ViewPortManager.syncDateAxisWithViewPort).
Argument | Default | Description |
id | (Mandatory) | The name of the data scale. |
minValue | (Mandatory) | The minimum value of the data scale. |
maxValue | (Mandatory) | The maximum value of the data scale. |
Some examples using this method:
CDViewPortManagerMBS.setKeepAspectRatio(value as boolean)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 21.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the viewport aspect ratio is keep unchanged, ViewPortManager will ensure the vertical and horizontal directions zoom by the same ratio.
Argument | Default | Description |
b | (Mandatory) | A true value ensures the vertical and horizontal directions zoom by the same ratio. A false value allows them to zoom independently. |
CDViewPortManagerMBS.setPlotAreaMouseMargin(leftMargin as Integer, rightMargin as Integer, topMargin as Integer, bottomMargin as Integer)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
SetPlotAreaMouseMargin configures some margins outside the plot area, so that a mouse cursor in that region (and therefore just outside the plot area) will still be considered to be exactly at the boundary of the plot area for the purpose of triggering plot area mouse events. Without this mechanism, it would be difficult to put the mouse exactly at the edge of the plot area (as it is too easy to "overshoot" the edge). Putting the mouse exactly at the edge is very useful for "track cursors" as this tracks the first or last data point.
Some examples using this method:
CDViewPortManagerMBS.setViewPortHeight(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The view port height is expressed as a fraction of the height of the underlying surface. It should be between 0 and 1.
Argument | Default | Description |
height | (Mandatory) | The height of the view port. |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setViewPortLeft(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The position of the view port left side is its distance from the left side of the underlying surface, as a fraction of the width of the underlying surface. It should be between 0 and 1.
Argument | Default | Description |
left | (Mandatory) | The position of the left side of the view port. |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setViewPortTop(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The position of the view port top side is its distance from the top side of the underlying surface, as a fraction of the height of the underlying surface. It should be between 0 and 1.
Argument | Default | Description |
top | (Mandatory) | The position of the top side of the view port. |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setViewPortWidth(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
The view port width is expressed as a fraction of the width of the underlying surface. It should be between 0 and 1.
Argument | Default | Description |
width | (Mandatory) | The width of the view port. |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setZoomInHeightLimit(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In many applications, it is desirable to set a maximum zoom in level, instead of allowing the user to zoom in indefinitely.
This method determines the minimum allowed view port height. It should be between 0 and 1. The default is 0.01, which means a maximum zoom in of 100x (the view port see only 1% of the underlying surface).
Argument | Default | Description |
height | (Mandatory) | The minimum allowed view port height. |
Some examples using this method:
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setZoomInWidthLimit(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In many applications, it is desirable to set a maximum zoom in level, instead of allowing the user to zoom in indefinitely.
This method determines the minimum allowed view port width. It should be between 0 and 1. The default is 0.01, which means a maximum zoom in of 100x (the view port see only 1% of the underlying surface).
Argument | Default | Description |
width | (Mandatory) | The minimum allowed view port width. |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setZoomOutHeightLimit(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
In many applications, it is desirable to set a maximum zoom in level, instead of allowing the user to zoom in indefinitely.
This method determines the minimum allowed view port height. It should be between 0 and 1. The default is 0.01, which means a maximum zoom in of 100x (the view port see only 1% of the underlying surface).
Argument | Default | Description |
height | (Mandatory) | The minimum allowed view port height. |
Some examples using this method:
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.setZoomOutWidthLimit(value as Double)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
CDViewPortManagerMBS.startDrag
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
This method must be called before calling ViewPortManager.dragTo.
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
CDViewPortManagerMBS.syncDateAxisWithViewPort(id as string, axis as CDAxisMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the data scale has already been defined (see ViewPortManager.setFullRange on how to define a data scale), this method will compute the visible data scale based on the view port coordinates using date/time interpolation, and then sets the axis to that date/time scale.
If the data scale has not been defined, this method will define the data scale based on the axis scale and the the view port coordinates using date/time extrapolation. Because the axis scale may not be known at the time of calling this method (the axis could be auto-scaled by ChartDirector, which may not occur until the chart is rendered), the definition of the data scale will not occur immediately, but will be pending until the chart is to be displayed.
If your charting code calls this method but never defines the full data scale or the view port coordinates (in which case the view port defaults to showing the complete data scale), then the first time the code is executed, the data scale will be defined to be equal to the axis scale. Subsequently, when the user zooms into the chart (which means the view port coordinates are changed), the same charting code will set up the axis scale to the range that the user has zoomed to.
Argument | Default | Description |
id | (Mandatory) | The name of the data scale. |
axis | (Mandatory) | The Axis object to synchronize with. |
CDViewPortManagerMBS.syncLinearAxisWithViewPort(id as string, axis as CDAxisMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the data scale has already been defined (see ViewPortManager.setFullRange on how to define a data scale), this method will compute the visible data scale based on the view port coordinates using linear interpolation, and then sets the axis to that linear scale.
If the data scale has not been defined, this method will define the data scale based on the axis scale and the the view port coordinates using linear extrapolation. Because the axis scale may not be known at the time of calling this method (the axis could be auto-scaled by ChartDirector, which may not occur until the chart is rendered), the definition of the data scale will not occur immediately, but will be pending until the chart is to be displayed.
If your charting code calls this method but never defines the full data scale or the view port coordinates (in which case the view port defaults to showing the complete data scale), then the first time the code is executed, the data scale will be defined to be equal to the axis scale. Subsequently, when the user zooms into the chart (which means the view port coordinates are changed), the same charting code will set up the axis scale to the range that the user has zoomed to.
Argument | Default | Description |
id | (Mandatory) | The name of the data scale. |
axis | (Mandatory) | The Axis object to synchronize with. |
CDViewPortManagerMBS.syncLogAxisWithViewPort(id as string, axis as CDAxisMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | ChartDirector | MBS ChartDirector Plugin | 12.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
If the data scale has already been defined (see ViewPortManager.setFullRange on how to define a data scale), this method will compute the visible data scale based on the view port coordinates using logarithmic interpolation, and then sets the axis to that logarithmic scale.
If the data scale has not been defined, this method will define the data scale based on the axis scale and the the view port coordinates using logarithmic extrapolation. Because the axis scale may not be known at the time of calling this method (the axis could be auto-scaled by ChartDirector, which may not occur until the chart is rendered), the definition of the data scale will not occur immediately, but will be pending until the chart is to be displayed.
If your charting code calls this method but never defines the full data scale or the view port coordinates (in which case the view port defaults to showing the complete data scale), then the first time the code is executed, the data scale will be defined to be equal to the axis scale. Subsequently, when the user zooms into the chart (which means the view port coordinates are changed), the same charting code will set up the axis scale to the range that the user has zoomed to.
Argument | Default | Description |
id | (Mandatory) | The name of the data scale. |
axis | (Mandatory) | The Axis object to synchronize with. |
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 |
Argument | Default | Description |
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 |
Argument | Default | Description |
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 |
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:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
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 |
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 |
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.
Argument | Default | Description |
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. |
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:
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
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 |
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.
Argument | Default | Description |
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). |
True if view port is changed, otherwise false.
Some examples using this method:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/math function plot centered and axes
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom improved
The items on this page are in the following plugins: MBS ChartDirector Plugin.