Platforms to show: All Mac Windows Linux Cross-Platform
CDViewPortManagerMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | ChartDirector | MBS ChartDirector Plugin | 8.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | All |
For example, a chart that has 10 years of data can be imagined as a very long chart. If one only displays one of the year, we can say the view port covers only 10% of the underlying chart.
With the view port concept, scrolling can be handled as moving the view port, while zooming in and out can be handled as changing the view port size.
ViewPortManager is a utility class for handling view ports. It manages mapping of the mouse and display pixel coordinates to view port coordinates, and supports various user interface constraints that limits how the view port may be changed.
View port coordinates are represented as fractions of the width or height of the underlying surface. For example, the width of a view port is represented as a fraction of the width of the underlying surface, so it must be between 0 to 1. A value of 0.1 means the view port width is 10% of the underlying surface width.
If you are using MFC, there is no need to create a ViewPortManager object directly. You may simply use the MFC CChartViewer control, which is a derived class of ViewPortManager and contains all its functions.
If you are using other GUI framework, and would like to perform zooming and scrolling functions by mouse drag, the ViewPortManager may be useful to you. The section Using ChartDirector with Other GUI Frameworks contains outlines on how the ViewPortManager may be used in general GUI frameworks.
- 45 methods
- method canZoomIn(zoomDirection as Integer) as boolean
- method canZoomOut(zoomDirection as Integer) as boolean
- method clearAllRanges
- method commitPendingSyncAxis(baseChart as CDBaseChartMBS)
- method Constructor
- method dragTo(scrollDirection as integer, x as double, y as double) as boolean
- method getPlotAreaHeight as Integer
- method getPlotAreaLeft as Integer
- method getPlotAreaTop as Integer
- method getPlotAreaWidth as Integer
- method getValueAtViewPort(id as string, ratio as Double, isLogScale as boolean = false) as Double
- method getViewPortAtValue(id as string, ratio as Double, isLogScale as boolean = false) as Double
- method getViewPortHeight as Double
- method getViewPortLeft as Double
- method getViewPortTop as Double
- method getViewPortWidth as Double
- method getZoomInHeightLimit as Double
- method getZoomInWidthLimit as Double
- method getZoomOutHeightLimit as Double
- method getZoomOutWidthLimit as Double
- method getZoomXYRatio as double
- method inExtendedPlotArea(x as Integer, y as Integer) as boolean
- method inPlotArea(x as double, y as double) as boolean
- method setChartMetrics(metrics as string)
- method setFullRange(ID as string, minValue as Double, maxValue as Double)
- method setKeepAspectRatio(value as boolean)
- method setPlotAreaMouseMargin(leftMargin as Integer, rightMargin as Integer, topMargin as Integer, bottomMargin as Integer)
- method setViewPortHeight(value as Double)
- method setViewPortLeft(value as Double)
- method setViewPortTop(value as Double)
- method setViewPortWidth(value as Double)
- method setZoomInHeightLimit(value as Double)
- method setZoomInWidthLimit(value as Double)
- method setZoomOutHeightLimit(value as Double)
- method setZoomOutWidthLimit(value as Double)
- method startDrag
- method syncDateAxisWithViewPort(id as string, axis as CDAxisMBS)
- method syncLinearAxisWithViewPort(id as string, axis as CDAxisMBS)
- method syncLogAxisWithViewPort(id as string, axis as CDAxisMBS)
- method updateFullRangeH(id as string, minValue as Double, maxValue as Double, updateType as Integer) as boolean
- method updateFullRangeV(id as string, minValue as Double, maxValue as Double, updateType as Integer) as boolean
- method validateViewPort
- method zoomAround(x as double, y as double, xZoomRatio as double, yZoomRatio as double) as boolean
- method zoomAt(zoomDirection as integer, x as double, y as double, zoomRatio as double) as boolean
- method zoomTo(zoomDirection as integer, x1 as double, y1 as double, x2 as double, y2 as double) as boolean
This class has no sub classes.
Some properties using for this class:
- CDViewPortControlBaseMBS.ViewPortManager as CDViewPortManagerMBS
Some examples using this class:
- /ChartDirector/ChartDirector Control
- /ChartDirector/ChartDirector Control Retina
- /ChartDirector/finance with ChartDirector Control
- /ChartDirector/math function plot
- /ChartDirector/math function plot centered
- /ChartDirector/RealTime ViewPort
- /ChartDirector/symbolline datezoom
- /ChartDirector/symbolline datezoom with date
- /ChartDirector/symbolline zoom
- /ChartDirector/symbolline zoom improved
Blog Entries
Release notes
- Version 21.2
- Fixed scaling issue with CDViewPortManagerMBS passing port size.
The items on this page are in the following plugins: MBS ChartDirector Plugin.
CDViewPortControlBaseMBS - CDXYChartMBS