ChartDirector 6.2 (.NET Edition)

WPFViewPortControl


The WPFViewPortControl is a WPF control to let the user visualize and manipulate the viewport managed by the WPFChartViewer. It is a subclass of the WPF Canvas.

In typical usage, the WPFViewPortControl displays an "overall chart" that shows the full data range, and connects to the WPFChartViewer using WPFViewPortControl.Viewer. It can then include a rectangle on the overall chart to represent the viewport in the WPFChartViewer. The region outside the rectangle can be dimmed out to highlight the viewport region. If the viewport is changed (such as if the user uses the mouse wheel to zoom in the chart), the rectangle will update automatically.

To manipulate the viewport, the user can drag the rectangle to move the viewport (equivalent to scrolling). The user can also resize the viewport by dragging the border of the rectangle (equivalent to zooming), or drag a new rectangular region on the overall chart to be used as the new viewport, or click on a point on the chart to center the viewport at that point.

Properties
NameDescription
ChartGets or sets the BaseChart object for displaying in the control. The chart usually is an overall chart that includes the full data range.
ViewerGets or Sets the WinChartViewer object to be associated with the WinViewPortControl.
ChartSizeModeDetermine the sizing method of the chart image.
DragInsideToMoveEnables or disables dragging inside the viewport to move it.
DragBorderToResizeEnables or disables dragging the viewport border to resize it.
DragOutsideToSelectEnables or disables dragging outside the viewport to select a new viewport.
ClickToCenterEnables or disables centering the viewport at the clicked point.
ViewPortExternalColorGets or sets the fill color for the region outside the viewport.
ViewPortBorderColorGets or sets the viewport border color.
ViewPortBorderWidthGets or sets the viewport border width.
ViewPortFillColorGets or sets the fill color for the region inside the viewport.
SelectionBorderColorGets or sets the border color of the selection box.
SelectionBorderWidthGets or sets the border width of the selection box.
Note: Properties inherited from System.Windows.Controls.Canvas are omitted.

Methods
NameDescription
setCursorSets the mouse cursors to be used at various parts of the control.
setMouseMarginSets the margin around the viewport border for mouse drag.
updateDisplayUpdates the display.
Note: Methods inherited from System.Windows.Controls.Canvas are omitted.

Events
NameDescription
Note: Events inherited from System.Windows.Controls.Canvas are omitted.