|Type||Topic||Plugin||Version||macOS||Windows||Linux||Console & Web||iOS|
|class||ChartDirector||MBS ChartDirector Plugin||8.2||Yes||Yes||Yes||Yes||No|
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.
- 43 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 Integer, y as Integer) 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 inExtendedPlotArea(x as Integer, y as Integer) as boolean
- method inPlotArea(x as Integer, y as Integer) as boolean
- method setChartMetrics(metrics as string)
- method setFullRange(ID as string, minValue as Double, maxValue as Double)
- 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 Integer, y as Integer, xZoomRatio as Double, yZoomRatio as Double) as boolean
- method zoomAt(zoomDirection as Integer, x as Integer, y as Integer, zoomRatio as Double) as boolean
- method zoomTo(zoomDirection as Integer, x1 as Integer, y1 as Integer, x2 as Integer, y2 as Integer) as boolean
This class has no sub classes.
Some examples which use this class:
- /ChartDirector/ChartDirector Control
- /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
The items on this page are in the following plugins: MBS ChartDirector Plugin.
MBS Xojo Chart Plugins