wxChartDir
2.0.1
|
Class representing a ChartDirector chart viewer control. More...
#include <wxchartviewer.h>
Public Member Functions | |
wxChartViewer (wxWindow *parent=0, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxPanelNameStr) | |
Constructor for a chart viewer control. More... | |
~wxChartViewer () | |
Destructor for a chart viewer control. | |
virtual void | setDPI (int dpi) |
Sets the DPI (scale factor) of the chart on the screen. More... | |
virtual int | getDPI () |
Gets the DPI (scale factor) of the chart on the screen. More... | |
virtual void | setChart (BaseChart *chart) |
Sets a BaseChart object for display. More... | |
virtual BaseChart * | getChart () |
Gets the BaseChart pointer provided by the previous wxChartViewer::setChart method call. More... | |
virtual void | setImageMap (const char *imageMap) |
Sets the image map that defines the hot spots on the chart image. More... | |
virtual ImageMapHandler * | getImageMapHandler () |
Gets the ImageMapHandler object for the current image map. More... | |
virtual void | setDefaultToolTip (const wxString &text) |
Sets the default tool tip to use when the mouse is over the wxChartViewer but not over any hot spot. More... | |
virtual void | setCDMLToolTipPrefix (const wxString &prefix) |
Sets the CDML tooltip prefix. More... | |
virtual void | setViewPortControl (wxViewPortControl *vpc) |
Sets the viewport control to be associated with this chart viewer control. More... | |
virtual wxViewPortControl * | getViewPortControl () |
Get the viewport control associated with this chart viewer control. More... | |
virtual void | setSelectionBorderWidth (int width) |
Sets the border width of the zoom selection box. More... | |
virtual int | getSelectionBorderWidth () |
Gets the border width of the zoom selection box. More... | |
virtual void | setSelectionBorderColor (const wxColour &color) |
Sets the border color of the zoom selection box as a wxColour value. More... | |
virtual wxColour | getSelectionBorderColor () |
Gets the border color of the zoom selection box. More... | |
virtual void | setSelectionBorderStyle (wxPenStyle style) |
Sets the border style of the zoom selection box. More... | |
virtual wxPenStyle | getSelectionBorderStyle () |
Gets the border style of the zoom selection box. More... | |
virtual void | setMouseUsage (int mouseUsage) |
Sets the mouse usage mode. More... | |
virtual int | getMouseUsage () |
Gets the mouse usage mode. More... | |
virtual void | setZoomDirection (int direction) |
Sets the zoom direction for mouse zoom in/out actions. More... | |
virtual int | getZoomDirection () |
Gets the zoom direction for mouse zoom in/out actions. More... | |
virtual void | setScrollDirection (int direction) |
Sets the scroll direction for mouse scroll actions. More... | |
virtual int | getScrollDirection () |
Gets the scroll direction for mouse scroll actions. More... | |
virtual void | setZoomInRatio (double ratio) |
Sets the magnification ratio for each zoom in click of the mouse. More... | |
virtual double | getZoomInRatio () |
Gets the magnification ratio for each zoom in click of the mouse. More... | |
virtual void | setZoomOutRatio (double ratio) |
Sets the magnification ratio for each zoom out click of the mouse. More... | |
virtual double | getZoomOutRatio () |
Gets the magnification ratio for each zoom out click of the mouse. More... | |
virtual void | setMouseWheelZoomRatio (double ratio) |
Sets the magnification ratio for each mouse wheel event. More... | |
virtual double | getMouseWheelZoomRatio () |
Gets the magnification ratio for each mouse wheel event. More... | |
virtual void | setMinimumDrag (int offset) |
Sets the minimum mouse drag distance before it is considered as an intentional drag. More... | |
virtual int | getMinimumDrag () |
Gets the minimum mouse drag distance before it is considered as an intentional drag. More... | |
virtual void | setUpdateInterval (int interval) |
Sets the minimum gap interval between two viewPortChanged signals in milliseconds. More... | |
virtual int | getUpdateInterval () |
Gets the minimum gap interval between two wxEVT_CHARTVIEWER_VIEWPORT_CHANGED events in milliseconds. More... | |
virtual bool | needUpdateChart () |
Determines if the current wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event requires chart update. More... | |
virtual bool | needUpdateImageMap () |
Determines if the current viewPortChanged signal requires image map update. More... | |
virtual bool | isMouseOnPlotArea () |
Checks if the mouse cursor is on the extended plot area. More... | |
virtual bool | isInMouseMoveEvent () |
Checks if the current code is executing in a wxEVT_CHARTVIEWER_MOUSEMOVE_CHART or wxEVT_CHARTVIEWER_MOUSEMOVE_PLOTAREA event. More... | |
virtual bool | isInViewPortChangedEvent () |
Checks if the current code is executing in a ViewPortChanged event. More... | |
virtual bool | isMouseDragging () |
Checks if the mouse is dragging on the plot area. More... | |
virtual void | updateViewPort (bool needUpdateChart, bool needUpdateImageMap) |
Triggers the wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event. More... | |
virtual void | updateDisplay () |
Updates the display. More... | |
virtual bool | onMouseWheelZoom (int x, int y, int zDelta) |
Handles mouse wheel zooming. More... | |
virtual void | removeDynamicLayer (const wxString &msg) |
Set the message used to remove the dynamic layer. More... | |
virtual int | getChartMouseX () |
Gets the mouse x-coordinate in the chart pixel coordinate system. More... | |
virtual int | getChartMouseY () |
Gets the mouse y-coordinate in the chart pixel coordinate system. More... | |
virtual int | getPlotAreaMouseX () |
Gets the mouse x-coordinate on the plot area in the chart pixel coordinate system. More... | |
virtual int | getPlotAreaMouseY () |
Gets the mouse y-coordinate on the plot area in the chart pixel coordinate system. More... | |
virtual double | getViewPortRight () |
Gets the position of the right side of the viewport. More... | |
virtual double | getViewPortBottom () |
Gets the position of the bottom side of the viewport. More... | |
Static Public Member Functions | |
static double | ConvertDateTimeToChartTime (wxDateTime dt) |
Convert from wxDateTime to chartTime. More... | |
static wxDateTime | ConvertChartTimeToDateTime (double ct) |
Convert from chartTime to wxDateTime. More... | |
Protected Member Functions | |
void | OnMouseMove (wxMouseEvent &evt) |
Handles mouse move events. More... | |
void | OnPaint (wxPaintEvent &evt) |
Handles the OnPaint event. More... | |
void | PaintNow (BaseChart *chart) |
Paints a chart immediately on screen. More... | |
void | Render (wxDC &dc, BaseChart *chart) |
Renders a chart to a device context. More... | |
virtual void | OnDelayedMouseMove () |
Handles a delayed mouse move event. | |
virtual void | OnMouseCaptureLost (wxMouseCaptureLostEvent &evt) |
Handles a mouse capture lost event. More... | |
virtual void | OnMousePressEvent (wxMouseEvent &evt) |
Handles a left mouse button down event. More... | |
virtual void | OnMouseReleaseEvent (wxMouseEvent &evt) |
Handles a left mouse button up event. More... | |
virtual void | OnLeaveEvent (wxMouseEvent &evt) |
Handles a control leave event. More... | |
virtual void | OnWheelEvent (wxMouseEvent &evt) |
Handles a mouse wheel event. More... | |
virtual void | OnHoldTimerEvent (wxTimerEvent &evt) |
Handles a hold timer event. More... | |
virtual void | OnDelayTimerEvent (wxTimerEvent &evt) |
Handles a delay timer event. More... | |
virtual void | OnSetCursor () |
Handles a set cursor event. | |
Class representing a ChartDirector chart viewer control.
wxChartViewer is a wxWidgets control that inherits from wxPanel and from ViewPortManager. It is used in wxWidgets applications for displaying chart images and to handle mouse interactions.
wxChartViewer::wxChartViewer | ( | wxWindow * | parent = 0 , |
wxWindowID | id = wxID_ANY , |
||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize , |
||
long | style = wxTAB_TRAVERSAL , |
||
const wxString & | name = wxPanelNameStr |
||
) |
Constructor for a chart viewer control.
parent | The parent window. |
id | An identifier for the panel. wxID_ANY is taken to mean a default. |
pos | The panel position. The value wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform. |
size | The panel size. The value wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform. |
style | The window style. |
name | Window name. |
|
static |
Convert from chartTime to wxDateTime.
Many functions in the ChartDirector API accept dates/times as parameters, in which the dates/times are represented as the seconds elapsed since 1-1-0001 00:00:00.
This function allows to convert a chartTime value to the corresponding wxDateTime value.
ct | chartTime value to be converted to a wxDateTime value |
|
static |
Convert from wxDateTime to chartTime.
Many functions in the ChartDirector API accept dates/times as parameters, in which the dates/times are represented as the seconds elapsed since 1-1-0001 00:00:00.
This function allows to convert a wxDateTime value to the corresponding chartTime value.
dt | wxDateTime value to be converted to ChartDirector's chartTime |
|
virtual |
Gets the BaseChart pointer provided by the previous wxChartViewer::setChart method call.
Gets the BaseChart pointer provided by the previous wxChartViewer::setChart method call.
|
virtual |
Gets the mouse x-coordinate in the chart pixel coordinate system.
This method is only valid when called inside the chart or plot area mouse events.
|
virtual |
Gets the mouse y-coordinate in the chart pixel coordinate system.
This method is only valid when called inside the chart or plot area mouse events.
|
virtual |
Gets the DPI (scale factor) of the chart on the screen.
|
virtual |
Gets the ImageMapHandler object for the current image map.
|
virtual |
Gets the minimum mouse drag distance before it is considered as an intentional drag.
|
virtual |
Gets the mouse usage mode.
|
virtual |
Gets the magnification ratio for each mouse wheel event.
Please refer to wxChartViewer::setMouseWheelZoomRatio for the usage of this ratio.
|
virtual |
Gets the mouse x-coordinate on the plot area in the chart pixel coordinate system.
If the mouse cursor is not on the plot area, but is on the extended plot area (see wxChartViewer::setPlotAreaMouseMargin), this method will behave as if the mouse cursor is on the nearest plot area edge.
If the mouse cursor is not even on the extended plot area mouse region, this method will return the last coordinate when the mouse cursor was still on the extended plot area.
This method is only valid when called inside the chart or plot area mouse events.
|
virtual |
Gets the mouse y-coordinate on the plot area in the chart pixel coordinate system.
If the mouse cursor is not on the plot area, but is on the extended plot area (see wxChartViewer::setPlotAreaMouseMargin), this method will behave as if the mouse cursor is on the nearest plot area edge.
If the mouse cursor is not even on the extended plot area mouse region, this method will return the last coordinate when the mouse cursor was still on the extended plot area.
This method is only valid when called inside the chart or plot area mouse events.
|
virtual |
Gets the scroll direction for mouse scroll actions.
Please refer to wxChartViewer::setZoomDirection for the supported directions.
|
virtual |
Gets the border color of the zoom selection box.
|
virtual |
Gets the border style of the zoom selection box.
|
virtual |
Gets the border width of the zoom selection box.
|
virtual |
Gets the minimum gap interval between two wxEVT_CHARTVIEWER_VIEWPORT_CHANGED events in milliseconds.
|
inlinevirtual |
Gets the position of the bottom side of the viewport.
The position of the viewport bottom side is its distance from the bottom side of the underlying surface, as a fraction of the height of the underlying surface. It should be between 0 and 1.
|
virtual |
Get the viewport control associated with this chart viewer control.
|
inlinevirtual |
Gets the position of the right side of the viewport.
The position of the viewport right side is its distance from the right side of the underlying surface, as a fraction of the width of the underlying surface. It should be between 0 and 1.
|
virtual |
Gets the zoom direction for mouse zoom in/out actions.
Please refer to wxChartViewer::setZoomDirection for the supported directions.
|
virtual |
Gets the magnification ratio for each zoom in click of the mouse.
For zoom in, the ratio should be greater than 1. The default is 2.
|
virtual |
Gets the magnification ratio for each zoom out click of the mouse.
For zoom out, the ratio should be less than 1. The default is 0.5.
|
virtual |
Checks if the current code is executing in a wxEVT_CHARTVIEWER_MOUSEMOVE_CHART or wxEVT_CHARTVIEWER_MOUSEMOVE_PLOTAREA event.
|
virtual |
Checks if the current code is executing in a ViewPortChanged event.
This is to help preventing "event looping" in complicated GUI designs in which multiple controls can update the viewport and indirectly update each others.
For example, suppose in a scrollable chart design, the x-axis can be scrolled by both a scroll bar control and a date/time picker control. That means both scroll bar and date/time picker events may update the viewport.
The following sequence of events may happen:
The above is potentially an infinite loop as the ViewPortChanged event will keep firing again and again. To avoid this, wxChartViewer::updateViewPort will perform no action if it is called within wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event. So the last step above cannot actually trigger another wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event. This avoids the infinite loop.
Internally, wxChartViewer::updateViewPort uses this method to check if it is called within a wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event, and ignores the request if it is already in the event. This method allows external code to also change behaviour in a wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event.
|
virtual |
Checks if the mouse is dragging on the plot area.
A mouse is considered to be dragging on the plot area if the mouse is on the plot area when the mouse button is down, and the mouse button still has not been released.
|
virtual |
Checks if the mouse cursor is on the extended plot area.
See wxChartViewer::setPlotAreaMouseMargin on what is the extended plot area.
|
virtual |
Determines if the current wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event requires chart update.
The event handler for a wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event can use this method to determine if chart update is necessary.
This method is only valid during handling of the wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event. Its behaviour is undefined at other times.
|
virtual |
Determines if the current viewPortChanged signal requires image map update.
The event handler for a wxEVT_CHARTVIEWER_VIEWPORT_CHANGED signal can use this method to determine if image map update is necessary.
This method is only valid during handling of the wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event. Its behaviour is undefined at other times.
|
protectedvirtual |
Handles a delay timer event.
evt | Timer event |
|
protectedvirtual |
Handles a hold timer event.
evt | Timer event |
|
protectedvirtual |
Handles a control leave event.
evt | Mouse event |
|
protectedvirtual |
Handles a mouse capture lost event.
evt | Mouse capture lost event |
|
protected |
Handles mouse move events.
evt | Mouse event |
|
protectedvirtual |
Handles a left mouse button down event.
evt | Mouse event |
|
protectedvirtual |
Handles a left mouse button up event.
evt | Mouse event |
|
virtual |
Handles mouse wheel zooming.
x | x-coordinate of the mouse cursor position |
y | y-coordinate of the mouse cursor position |
zDelta | The sign of zDelta determines the zoom direction (i.e. zoom in or zoom out) |
|
protected |
Handles the OnPaint event.
evt | Paint event |
|
protectedvirtual |
Handles a mouse wheel event.
evt | Mouse event |
|
protected |
Paints a chart immediately on screen.
chart | chart object to be painted on screen |
|
virtual |
Set the message used to remove the dynamic layer.
The dynamic layer (see BaseChart.initDynamicLayer) is commonly used for drawing track cursors. For these type of usages, it is often necessary to clear the dynamic layer when the mouse cursor leaves the plot area. The removeDynamicLayer method can be used in the dynamic layer drawing code to automatically clear the dynamic layer when the specified event occurs. This avoids the need to set up a separate event handler to call BaseChart.removeDynamicLayer.
In the current version of ChartDirector, this method only supports the eventId "MouseLeaveChart" and "MouseLeavePlotArea".
This method only applies to the first occurrence of the specified event after calling this method. If this method is called multiple times before the event occurs, only the last call has effect. To cancel this method, use an empty string as the eventId.
msg | The event that causes BaseChart.removeDynamicLayer to be called. |
|
protected |
Renders a chart to a device context.
dc | screen device context |
chart | chart object to be rendered on screen |
|
virtual |
Sets the CDML tooltip prefix.
wxChartViewer supports both standard tooltips and CDML tooltips. If the tooltip content starts with a CDML tag, it will be processed as a CDML tooltip, otherwise it will be processed as a standard tooltip. Standard tooltips are drawn by the GUI framework, so their style will be the same as in other GUI controls. CDML tooltips are drawn by ChartDirector, and can use multiple fonts and colors, contain tables and icons, and be semi-transparent.
For CDML tooltips, if the tooltip content starts with "<*cdml*>", wxChartViewer will substitute it with the following CDML. It configures a white rounded rectangle with grey border as the tooltip container and sets the tooltip font color to black. The setCDMLToolTipPrefix method can be use to change CDML that substitute the "<*cdml*>" tag.
prefix | The text used to substitute the leading <cdml> tag. |
|
virtual |
Sets a BaseChart object for display.
wxChartViewer stores the BaseChart pointer internally so it can later be retrieved with wxChartViewer::getChart. However, wxChartViewer does not use the stored pointer itself. So it is perfectly safe to immediately delete the BaseChart after calling wxChartViewer::setChart, or to use a BaseChart that is allocated on the stack for this method.
chart | The BaseChart object to be displayed. |
|
virtual |
Sets the default tool tip to use when the mouse is over the wxChartViewer but not over any hot spot.
text | The default tool tip text to use. |
|
virtual |
Sets the DPI (scale factor) of the chart on the screen.
Due to historical reasons, in programming, the display is assumed to be 96dpi (dot per inch). Modern operating systems also allows using higher DPI. For example, on Windows 10, in "Settings / System / Display", it is possible set a display scale factor such as 150%, which corresponds to 144dpi.
If the application is configured as "not DPI aware", the OS will assume the application GUI is 96dpi. The operating system will then resize the application output before displaying it on the screen.
If the application is configured as "DPI aware", the OS will assume the application will resize its GUI to match the display DPI, and the OS will not resize the application output again.
wxChartViewer will automatically detect if the application is "DPI aware" or not, and will automatically resize the chart to match the display DPI.
The setDPI method can be used to configure an alternative scale factor. For example, if the user code has already resized the chart, it is not necessary for the wxChartViewer to resize the chart again. In this case, setDPI can be used to set the DPI to 96 to disable the wxChartViewer from resizing the chart.
dpi | The DPI to display the chart on the screen. A value of 0 means the DPI will be automatically determined. |
|
virtual |
Sets the image map that defines the hot spots on the chart image.
By using an image map, a wxChartViewer object can be configured to display tool tips specific to the hot spots when the mouse is over the hot spots. The mouse cursor can also change to a "hand" shape to provide visual feedback for clickable hot spots. A clickable hot spot is defined as a hot spot with a non-empty path attribute.
BaseChart.getHTMLImageMap can be used to generated image maps for charts automatically.
The ImageMapHandler object, accessible via wxChartViewer::getImageMapHandler, can be used to determine if the mouse cursor is over a hot spot and to retrieve the hot spot parameters.
imageMap | The image map that defines the hot spots. |
|
virtual |
Sets the minimum mouse drag distance before it is considered as an intentional drag.
A mouse drag occurs if the mouse button is down while the mouse moves. However, sometimes a user may want to click on a point, but due to mouse vibrations, the mouse moves by a small amount while the button is still down. This may then be interpreted as a mouse drag.
This method determines the minimum drag distance in pixels before it is considered as an intentional drag. The default is 5 pixels. Non-intentional drags will be handled as mouse clicks instead of drags.
offset | The minimum mouse drag distance in pixels before it is considered as an intentional drag. |
|
virtual |
Sets the mouse usage mode.
The following table describes the supported mouse usage modes and the mouse behaviour in each mode.
Constant | Value | Description |
---|---|---|
MouseUsageDefault | 0 | This represents the default mouse behaviour, which is to support tool tips and hot spot events as defined by the image map. See wxChartViewer::setImageMap on how to define an image map for a chart. |
MouseUsageScroll | 1 | The mouse is used for drag scrolling the chart. When the mouse drags on the plot area, the mouse cursor will change to a scroll cursor, the viewport coordinates will shift to reflect the amount dragged, and viewPortChanged signals will be emitted. If the mouse is not dragging inside the plot area, its behaviour is the same as the default mouse behaviour. |
MouseUsageZoomIn | 3 | The mouse is used for zoom in actions. When the mouse is inside the plot area, the following behaviour will apply:
|
MouseUsageZoomOut | 4 | The mouse is used for zoom out actions. When the mouse is inside the plot area, the following behaviour will apply:
|
mouseUsage | The mouse usage mode of the control, which must be one of the predefined constants as shown in the table above. |
|
virtual |
Sets the magnification ratio for each mouse wheel event.
The magnification ratio is applied when the mouse wheel rolls towards the screen. The reciprocal of the ratio is applied when the mouse wheel rolls away from the screen. A ratio larger than 1 means to zoom in when the mouse wheel rolls towards the screen, and to zoom out when the mouse wheel rolls away from the screen. A ratio less than 1 means the opposite behaviour. A ratio equal to 1 disables mouse wheel zooming.
The mouse wheel causes zooming to occur, it will trigger the wxEVT_CHARTVIEWER_VIEWPORT_CHANGED message.
ratio | The magnification ratio. |
|
virtual |
Sets the scroll direction for mouse scroll actions.
Please refer to wxChartViewer::setZoomDirection for the supported directions.
direction | The scroll direction for mouse scroll actions. |
|
virtual |
Sets the border color of the zoom selection box as a wxColour value.
color | The border color as a wxColour value. |
|
virtual |
Sets the border style of the zoom selection box.
style | The border style of the zoom selection box. |
|
virtual |
Sets the border width of the zoom selection box.
width | The border width in pixels. |
|
virtual |
Sets the minimum gap interval between two viewPortChanged signals in milliseconds.
Some GUI designs may be capable of generate a lot of viewPortChanged events rapidly. For example, an external scroll bar may update the viewport and call wxChartViewer::updateViewPort rapidly and repeatedly when it is scrolling. As the chart is usually updated in the main GUI thread, updating too rapidly without a gap interval in between may cause other GUI elements to become sluggish.
This method specifies the minimum gap interval between two viewPortChanged signals. The default is 20ms.
If a viewPortChanged event needs to be emitted during the gap interval, the signal will be delayed and emitted after the gap interval.
If multiple viewPortChanged events needs to be emitted during the gap interval, they will be merged into one event, and be emitted after the gap interval.
interval | The minimum gap interval between two viewPortChanged signals in milliseconds. |
|
virtual |
Sets the viewport control to be associated with this chart viewer control.
vpc | The viewport control to be associated with this chart viewer. |
|
virtual |
Sets the zoom direction for mouse zoom in/out actions.
In zoom operations for charts, it is common to restrict zooming to one direction only. For example, in a chart plotting temperature against time, zooming in from a yearly chart to a daily chart may mean the time axis (x-axis) is zoomed in by 36500%, while the temperature axis (y-axis) may be auto-scaled and not zoomed in at all. The user may be surprise if you also zoom in the y-axis by 36500%, in which case the chart may become hardly readable.
This method allows you to determine the zoom direction for mouse zoom actions (see wxChartViewer::setMouseUsage), specified using the following predefined constants:
Constant | Value | Description |
---|---|---|
DirectionHorizontal | 0 | Zoom actions apply to horizontal direction only. |
DirectionVertical | 1 | Zoom actions apply to vertical direction only. |
DirectionHorizontalVertical | 2 | Zoom actions apply to both horizontal and vertical directions. |
direction | The zoom direction for mouse zoom actions. |
|
virtual |
Sets the magnification ratio for each zoom in click of the mouse.
For zoom in, the ratio should be greater than 1. The default is 2.
ratio | The zoom in ratio. |
|
virtual |
Sets the magnification ratio for each zoom out click of the mouse.
For zoom out, the ratio should be less than 1. The default is 0.5.
ratio | The zoom out ratio. |
|
virtual |
Updates the display.
If a chart is assigned to a wxChartViewer for display, the wxChartViewer will automatically display it. If the chart is subsequently modified (eg. by drawing additional things in its dynamic layer - see BaseChart.initDynamicLayer), this method can be used to notify the wxChartViewer that the modification has been completed so that it can update the display.
|
virtual |
Triggers the wxEVT_CHARTVIEWER_VIEWPORT_CHANGED event.
wxChartViewer may emit wxEVT_CHARTVIEWER_VIEWPORT_CHANGED events when the mouse clicks or drags on the plot area (see wxChartViewer::setMouseUsage). wxChartViewer also allows external objects (such as scroll bars, navigation buttons, timers, etc) to modify the viewport. This method allows external objects to request wxChartViewer to emit wxEVT_CHARTVIEWER_VIEWPORT_CHANGED events.
Many controls are able to update the viewport continuously as they are used. For example, a scroll bar may update the viewport continuously as the mouse drags on it. For these cases, the chart display may be updated continuously as the viewport changes. However, the image map does not need to update until the scrolling is completed (when the mouse button is released on the scroll bar and the mouse moves over the chart surface).
The needUpdateChart argument and needUpdateImageMap argument allows one to specify if the event requires a chart update, and/or an image map update.
For charts with a lot of hot spots and tool tips, the CPU power needed to handle the image map may not be negligible. Removing unnecessary image map updates may increase the update rate when the chart is being updated continuously.
needUpdateChart | A boolean value to indicate if the chart needs to be updated. |
needUpdateImageMap | A boolean value to indicate if the image map needs to be updated. |