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
Function: A view port can be imagined as a rectangular window of an underlying rectangular surface.
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.

This class has no sub classes.

Some properties using for this class:

Some examples using this class:

Blog Entries

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

CDViewPortControlBaseMBS   -   CDXYChartMBS

Feedback: Report problem or ask question.

The biggest plugin in space...

Start Chat