## wxPlotWindow

wxPlotWindow is a specialized window designed to display data that typically has been measured by machines, i.e. that may have thousands of values. One example of such data would be the well known ECG measuring the electrical activity of your heart: the measuring device will produce thousands of values per minute, several measurements are done simultanously and you might want to have a look at parts of the curves, enlarging them or scrolling from one position to another. Note that this window is not useful for real-time measuring or for displaying charts with error bars etc.

A single curve in the plot window is represented by the wxPlotCurve class.

The wxPlotWindow interacts with program using events, for example when clicking or double clicking on a curve or when selecting one by clicking on it (which can be vetoed). Future versions will hopefully feature selecting values or sections of the displayed curves etc.

Derived from

wxScrolledWindow
wxPanel
wxWindow
wxEvtHandler
wxObject

Window styles

wxPLOT_BUTTON_MOVE | Display buttons to allao moving individual curves up or down.
wxPLOT_BUTTON_ENLARGE | Display buttons to allow enlarging individual curves vertically.
wxPLOT_BUTTON_ZOOM | Display buttons to allow zooming all curves horizontally.
wxPLOT_BUTTON_ALL | Display all buttons.
wxPLOT_Y_AXIS | Display an Y axis to the left of the drawing area.
wxPLOT_X_AXIS | Display a X axis at the bottom of the drawing area.
wxPLOT_DEFAULT | All of the above options.

Members

wxPlotWindow::wxPlotWindow
wxPlotWindow::~wxPlotWindow
wxPlotWindow::Add
wxPlotWindow::GetCount
wxPlotWindow::GetAt
wxPlotWindow::SetCurrent
wxPlotWindow::GetCurrent
wxPlotWindow::Delete
wxPlotWindow::Move
wxPlotWindow::Enlarge
wxPlotWindow::SetUnitsPerValue
wxPlotWindow::GetUnitsPerValue
wxPlotWindow::SetZoom
wxPlotWindow::GetZoom
wxPlotWindow::RedrawEverything
wxPlotWindow::RedrawXAxis
wxPlotWindow::RedrawYAxis
wxPlotWindow::SetScrollOnThumbRelease
wxPlotWindow::SetEnlargeAroundWindowCentre

### wxPlotWindow::wxPlotWindow

wxPlotWindow()

wxPlotWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, int flags = wxPLOT_DEFAULT)

Constructor.

### wxPlotWindow::~wxPlotWindow

~wxPlotWindow()

The destructor will not delete the curves associated to the window.

### wxPlotWindow::Add

void Add(wxPlotCurve* curve)

Add a curve to the window.

### wxPlotWindow::GetCount

size_t GetCount()

Returns number of curves.

### wxPlotWindow::GetAt

wxPlotCurve* GetAt(size_t n)

Get the nth curve.

### wxPlotWindow::SetCurrent

void SetCurrent(wxPlotCurve* current)

Make one curve the current curve. This will emit a wxPlotEvent.

### wxPlotWindow::GetCurrent

wxPlotCurve* GetCurrent()

Returns a pointer to the current curve, or NULL.

### wxPlotWindow::Delete

void Delete(wxPlotCurve* curve)

Removes a curve from the window and delete is on screen. This does not delete the actual curve. If the curve removed was the current curve, the current curve will be set to NULL.

### wxPlotWindow::Move

void Move(wxPlotCurve* curve, int pixels_up)

Move the curve `curve` up by `pixels_up` pixels. Down if the value is negative.

### wxPlotWindow::Enlarge

void Enlarge(wxPlotCurve* curve, double factor)

Changes the representation of the given curve. A `factor` of more than one will stretch the curve vertically. The Y axis will change accordingly.

### wxPlotWindow::SetUnitsPerValue

void SetUnitsPerValue(double upv)

This sets the virtual untis per value. Normally, you will not be interested in what measured value you see, but what it stands for. If you want to display seconds on the X axis and the measuring device produced 50 values per second, set this value to 50. This will affect all curves being displayed.

### wxPlotWindow::GetUnitsPerValue

double GetUnitsPerValue()

See SetUnitsPerValue.

### wxPlotWindow::SetZoom

void SetZoom(double zoom)

This functions zooms all curves in their horizontal dimension. The X axis will be changed accordingly.

### wxPlotWindow::GetZoom

double GetZoom()

See SetZoom.

### wxPlotWindow::RedrawEverything

void RedrawEverything()

Helper function which redraws both axes and the central area.

### wxPlotWindow::RedrawXAxis

void RedrawXAxis()

Helper function which redraws the X axis.

### wxPlotWindow::RedrawYAxis

void RedrawYAxis()

Helper function which redraws the Y axis.

### wxPlotWindow::SetScrollOnThumbRelease

void SetScrollOnThumbRelease(bool onrelease = TRUE)

This function controls if the plot area will get scrolled only if the scrollbar thumb has been release or also if the thumb is being dragged. When displaying large amounts of data, it might become impossible to display the data fast enough to produce smooth scrolling and then this function should be called.

### wxPlotWindow::SetEnlargeAroundWindowCentre

void SetEnlargeAroundWindowCentre(bool aroundwindow = TRUE)

Depending on the kind of data you display, enlarging the individual curves might have different desired effects. Sometimes, the data will be supposed to get enlarged with the fixed point being the origin, sometimes the fixed point should be the centre of the current drawing area. This function controls this behaviour.