ChartDirector 5.1 (Java Edition)

ChartViewer


The ChartViewer control is a SWING control for viewing ChartDirector charts. It is a subclass of the JLabel control. Apart from displaying the charts, its main functions are to support advanced user interactions with the charts, including:

ChartViewer Members

The followings are members specific to the ChartViewer control. Members inherited from the JLabel control are omitted. Please refer to Java documentation for members of the JLabel control.

MethodInheritedDescription
ChartViewer(Self)Constructor for the ChartViewer component.
setChart(Self)Sets a BaseChart object for display.
getChart(Self)Gets the BaseChart pointer provided by the previous ChartViewer.setChart method call.
setImage(Self)Sets the chart image to view.
getImage(Self)Gets the chart image that is being viewed.
setImageMap(Self)Sets the image map that defines the hot spots on the chart image.
getImageMap(Self)Gets the image map that is currently in use for defining the hot spots.
disposeReference(Self)Remove the stored reference to the BaseChart object and image map string set using ChartViewer.setChart and ChartViewer.setImageMap.
getChartMouseX(Self)Gets the mouse cursor x-coordinate in the chart pixel coordinate system.
getChartMouseY(Self)Gets the mouse cursor y-coordinate in the chart pixel coordinate system.
getPlotAreaMouseX(Self)Gets the mouse cursor x-coordinate on the plot area in the chart pixel coordinate system.
getPlotAreaMouseY(Self)Gets the mouse cursor y-coordinate on the plot area in the chart pixel coordinate system.
setPlotAreaMouseMargin(Self)Sets all margins (left, right, top, and bottom) of the plot area mouse event region to the same value.
setPlotAreaMouseMargin2(Self)Sets the margins of the plot area mouse event region.
removeDynamicLayer(Self)Calls BaseChart.removeDynamicLayer when the specified event occurs.
updateDisplay(Self)Updates the display.
setViewPortLeft(Self)Sets the position of the left side of the view port.
getViewPortLeft(Self)Gets the position of the left side of the view port.
setViewPortTop(Self)Sets the position of the top side of the view port.
getViewPortTop(Self)Gets the position of the top side of the view port.
setViewPortWidth(Self)Sets the width of the view port.
getViewPortWidth(Self)Gets the width of the view port.
setViewPortHeight(Self)Sets the height of the view port.
getViewPortHeight(Self)Gets the height of the view port.
validateViewPort(Self)Ensures the view port left, top, width and height are within valid ranges and adjusts them if necessary.
setMouseUsage(Self)Sets the mouse usage mode.
getMouseUsage(Self)Gets the mouse usage mode.
setZoomDirection(Self)Sets the zoom direction for mouse zoom in/out actions.
getZoomDirection(Self)Gets the zoom direction for mouse zoom in/out actions.
setScrollDirection(Self)Sets the scroll direction for mouse scroll actions.
getScrollDirection(Self)Gets the scroll direction for mouse scroll actions.
setZoomInRatio(Self)Sets the magnification ratio for each zoom in click of the mouse.
getZoomInRatio(Self)Gets the magnification ratio for each zoom in click of the mouse.
setZoomOutRatio(Self)Sets the magnification ratio for each zoom out click of the mouse.
getZoomOutRatio(Self)Gets the magnification ratio for each zoom out click of the mouse.
setZoomInWidthLimit(Self)Sets the view port width at maximum zoom in.
getZoomInWidthLimit(Self)Gets the view port width at maximum zoom in for mouse zoom in actions.
setZoomOutWidthLimit(Self)Sets the view port width at maximum zoom out.
getZoomOutWidthLimit(Self)Gets the view port width at maximum zoom out for mouse zoom out actions.
setZoomInHeightLimit(Self)Sets the view port height at maximum zoom in.
getZoomInHeightLimit(Self)Gets the view port height at maximum zoom in for mouse zoom in actions.
setZoomOutHeightLimit(Self)Sets the view port height at maximum zoom out.
getZoomOutHeightLimit(Self)Gets the view port height at maximum zoom out for mouse zoom out actions.
setMinimumDrag(Self)Sets the minimum mouse drag distance before it is considered as an intentional drag.
getMinimumDrag(Self)Gets the minimum mouse drag distance before it is considered as an intentional drag.
setSelectionBorderWidth(Self)Sets the border width of the zoom selection box.
getSelectionBorderWidth(Self)Gets the border width of the zoom selection box.
setSelectionBorderColor(Self)Sets the border color of the zoom selection box as a java.awt.Color.
getSelectionBorderColor(Self)Gets the border color of the zoom selection box.
setHotSpotCursor(Self)Sets the cursor that is displayed when the mouse cursor is over a normal hot spot.
getHotSpotCursor(Self)Gets the cursor that is displayed when the mouse cursor is over a normal hot spot.
setZoomInCursor(Self)Sets the mouse cursor to be used when the mouse is used for zoom in.
getZoomInCursor(Self)Gets the mouse cursor to be used when the mouse is used for zoom in.
setZoomOutCursor(Self)Sets the mouse cursor to be used when the mouse is used for zoom out.
getZoomOutCursor(Self)Gets the mouse cursor to be used when the mouse is used for zoom out.
setNoZoomCursor(Self)Sets the mouse cursor to be used when the mouse is used for zoom in/out, but the zoom in/out limits has been reached.
getNoZoomCursor(Self)Gets the mouse cursor to be used when the mouse is used for zoom in/out, but the zoom in/out limits has been reached.
setScrollCursor(Self)Sets the mouse cursor to be used when the mouse is used for scrolling.
getScrollCursor(Self)Gets the mouse cursor to be used when the mouse is used for scrolling.
setUpdateInterval(Self)Sets the minimum gap interval between two ViewPortChanged events in milliseconds.
getUpdateInterval(Self)Gets the minimum gap interval between two ViewPortChanged events in milliseconds.
updateViewPort(Self)Triggers the ViewPortChanged event.
setFullRange(Self)Defines the full range of a view port data scale.
getValueAtViewPort(Self)Converts a view port coordinate to a value of the specified data scale.
getViewPortAtValue(Self)Converts a value of the specified data scale to a view port coordinate.
syncLinearAxisWithViewPort(Self)Synchronizes a linear Axis with the part of the data scale in view port.
syncLogAxisWithViewPort(Self)Synchronizes a logarithmic Axis with the part of the data scale in view port.
syncDateAxisWithViewPort(Self)Synchronizes a date/time Axis with the part of the data scale in view port.
isMouseOnPlotArea(Self)Checks if the mouse cursor is on the extended plot area.
isInMouseMoveEvent(Self)Checks if the current code is executing in a MouseMovedChart or MouseMovedPlotArea event.
isInViewPortChangedEvent(Self)Checks if the current code is executing in a ViewPortChanged event.
addTrackCursorListener(Self)Adds the specified TrackCursorListener to receive track cursor related events.
removeTrackCursorListener(Self)Remove the specified TrackCursorListener so that it no longer receives track cursor related events.
addHotSpotListener(Self)Adds the specified HotSpotListener to receive hot spot mouse events.
removeHotSpotListener(Self)Remove the specified HotSpotListener so that it no longer receives hot spot mouse events.
addHotSpotMotionListener(Self)Adds the specified HotSpotMotionListener to receive hot spot mouse motion events.
removeHotSpotMotionListener(Self)Remove the specified HotSpotMotionListener so that it no longer receives hot spot mouse motion events.
addViewPortListener(Self)Adds the specified ViewPortListener to receive view port events.
removeViewPortListener(Self)Remove the specified ViewPortListener so that it no longer receives view port events.
processHotSpotEvent(Self)Process hot spot mouse events.
processHotSpotMotionEvent(Self)Process hot spot mouse motion events.
Note: Methods inherited from JLabel are omitted.