wxPlot 1.8 Real time plot library for wxWidgets

Loading...
Searching...
No Matches
Public Member Functions | List of all members
PlotFigure Class Reference

This is the plot figure class. It contains plot figures such as 2D, 3D and customs. More...

`#include <plotfigures.hpp>`

## Public Member Functions
void | setWxPlotFigureType (const WXPLOT_FIGURE wxPlotFigure, const WXPLOT_TYPE wxPlotType)
| Set the plot type selection and plot figure selection.
void | setFontSize (const unsigned int fontSize)
| Set the size of the fonts.
void | setTitle (const wxString &title)
| Set the title of the plot.
void | setXlabel (const wxString &xLabel)
| Set the name of the X-label.
void | setYlabel (const wxString &yLabel)
| Set the name of the Y-label.
void | setTicks (const unsigned int ticks)
| Set the number of ticks at the figure in all axis.
void | gridOn (const bool useGrid)
| Enable grid on the figure.
void | setPlotStartWidth (const wxCoord plotStartWidth)
| Set the left upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
void | setPlotStartHeight (const wxCoord plotStartHeight)
| Set the left upper corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
void | setPlotEndWidth (const wxCoord plotEndWidth)
| Set the right upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
void | setPlotEndHeight (const wxCoord plotEndHeight)
| Set the right bottom corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)
void | setData (const std::vector< std::vector< double > > &data2D)
| Set 2D data.
void | setData (const std::vector< double > &data1D)
| Set 1D data.
void | legendOn (const bool useLegend)
| Activate the legend.
void | setLegend (const std::vector< wxString > &legend, const PLACEMENT legendPosition=PLACEMENT_NORTH_EAST)
| Set the labels and placement for the legend.
void | setBinCount (const unsigned int binCount)
| Set the bin count for e.g. histogram.
void | setYlim (const double minY, const double maxY)
| Set the plot zoom limit in Y-axis.
wxCoord | getPlotStartWidth () const
| Get the recalculated start width X-axis value. This value is recalculated after the figure is drawn.
wxCoord | getPlotEndWidth () const
| Get the recalculated end width X-axis value. This value is recalculated after the figure is drawn.
wxCoord | getPlotStartHeight () const
| Get the recalculated start height Y-axis value. This value is recalculated after the figure is drawn.
wxCoord | getPlotEndHeight () const
| Get the recalculated end height Y-axis value. This value is recalculated after the figure is drawn.
void | drawFigure (wxDC &dc)
| This function will do the following:
void | drawGrid (wxDC &dc)
| This function will draw the grid. Call this function after you have drawn the plot type.
void | drawTicks (wxDC &dc)
| This function will draw the ticks. Call this function after you have drawn the plot type.
void | drawLegend (wxDC &dc)
| This function will draw the legend. Call this function after you have drawn the plot type.

## Detailed Description

This is the plot figure class. It contains plot figures such as 2D, 3D and customs.

## Member Function Documentation

## ◆ drawFigure()

void PlotFigure::drawFigure | ( | wxDC & | dc | ) |

This function will do the following:

- Set the fonts
- Draw the title
- Draw the y-label
- Draw the x-label
- Draw the rectangle
- Update the plotStartHeight, plotEndtHeight, plotStartWidth and plotEndtWidth for correct plotting the plot type
  Parameters

    dc | The wxDC object for drawing lines, polygons etc.

## ◆ drawGrid()

void PlotFigure::drawGrid | ( | wxDC & | dc | ) |

This function will draw the grid. Call this function after you have drawn the plot type.

Parameters

  dc | The wxDC object for drawing lines, polygons etc.

## ◆ drawLegend()

void PlotFigure::drawLegend | ( | wxDC & | dc | ) |

This function will draw the legend. Call this function after you have drawn the plot type.

Parameters

  dc | The wxDC object for drawing lines, polygons etc.

## ◆ drawTicks()

void PlotFigure::drawTicks | ( | wxDC & | dc | ) |

This function will draw the ticks. Call this function after you have drawn the plot type.

Parameters

  dc | The wxDC object for drawing lines, polygons etc.

## ◆ getPlotEndHeight()

wxCoord PlotFigure::getPlotEndHeight | ( |  | ) | const

Get the recalculated end height Y-axis value. This value is recalculated after the figure is drawn.

Returns
  wxCoord Recalculated value

## ◆ getPlotEndWidth()

wxCoord PlotFigure::getPlotEndWidth | ( |  | ) | const

Get the recalculated end width X-axis value. This value is recalculated after the figure is drawn.

Returns
  wxCoord Recalculated value

## ◆ getPlotStartHeight()

wxCoord PlotFigure::getPlotStartHeight | ( |  | ) | const

Get the recalculated start height Y-axis value. This value is recalculated after the figure is drawn.

Returns
  wxCoord Recalculated value

## ◆ getPlotStartWidth()

wxCoord PlotFigure::getPlotStartWidth | ( |  | ) | const

Get the recalculated start width X-axis value. This value is recalculated after the figure is drawn.

Returns
  wxCoord Recalculated value

## ◆ gridOn()

void PlotFigure::gridOn | ( | const bool | useGrid | ) |

Enable grid on the figure.

Parameters

  useGrid | Set true for enabling grid.

## ◆ legendOn()

void PlotFigure::legendOn | ( | const bool | useLegend | ) |

Activate the legend.

Parameters

  useLegend | Set true to make a little box with labels appear.

## ◆ setBinCount()

void PlotFigure::setBinCount | ( | const unsigned int | binCount | ) |

Set the bin count for e.g. histogram.

Parameters

  binCount | Bin count is total columns inside a e.g historam chart.

## ◆ setData() [1/2]

void PlotFigure::setData | ( | const std::vector< double > & | data1D | ) |

Set 1D data.

Parameters

  data1D | 1D data in form of 1D vector.

## ◆ setData() [2/2]

void PlotFigure::setData | ( | const std::vector< std::vector< double > > & | data2D | ) |

Set 2D data.

Parameters

  data2D | 2D data in form of 2D vector.

## ◆ setFontSize()

void PlotFigure::setFontSize | ( | const unsigned int | fontSize | ) |

Set the size of the fonts.

Parameters

  fontSize | The size of the fonts.

## ◆ setLegend()

void PlotFigure::setLegend | ( | const std::vector< wxString > & | legend,
|  | const PLACEMENT | legendPosition = PLACEMENT_NORTH_EAST )

Set the labels and placement for the legend.

Parameters

  legend | Vector of strings for the legend.
  legendPosition | Position where the legend should be placed.

## ◆ setPlotEndHeight()

void PlotFigure::setPlotEndHeight | ( | const wxCoord | plotEndHeight | ) |

Set the right bottom corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters

  plotEndHeight | End height is at the end of Y-axis.

## ◆ setPlotEndWidth()

void PlotFigure::setPlotEndWidth | ( | const wxCoord | plotEndWidth | ) |

Set the right upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters

  plotEndWidth | End width is at the end of X-axis.

## ◆ setPlotStartHeight()

void PlotFigure::setPlotStartHeight | ( | const wxCoord | plotStartHeight | ) |

Set the left upper corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters

  plotStartHeight | Start height is at the start of Y-axis.

## ◆ setPlotStartWidth()

void PlotFigure::setPlotStartWidth | ( | const wxCoord | plotStartWidth | ) |

Set the left upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is recalculated since the plot figure is drawn! (plotStartWidth, plotStartHeight) --------------------------------------------— (plotEndWidth, plotStartHeight)

(plotStartWidth, plotEndHeight) --------------------------------------------— (plotEndWidth, plotEndHeight)

Parameters

  plotStartWidth | Start width is at the start of X-axis.

## ◆ setTicks()

void PlotFigure::setTicks | ( | const unsigned int | ticks | ) |

Set the number of ticks at the figure in all axis.

Parameters

  ticks | Number of ticks.

## ◆ setTitle()

void PlotFigure::setTitle | ( | const wxString & | title | ) |

Set the title of the plot.

Parameters

  title | Name of the title.

## ◆ setWxPlotFigureType()

void PlotFigure::setWxPlotFigureType | ( | const WXPLOT_FIGURE | wxPlotFigure,
|  | const WXPLOT_TYPE | wxPlotType )

Set the plot type selection and plot figure selection.

Parameters

  wxPlotFigure | Selection of plot figure.
  wxPlotType | Selection of plot type.

## ◆ setXlabel()

void PlotFigure::setXlabel | ( | const wxString & | xLabel | ) |

Set the name of the X-label.

Parameters

  xLabel | Name of the X-label.

## ◆ setYlabel()

void PlotFigure::setYlabel | ( | const wxString & | yLabel | ) |

Set the name of the Y-label.

Parameters

  yLabel | Name of the Y-label.

## ◆ setYlim()

void PlotFigure::setYlim | ( | const double | minY,
|  | const double | maxY )

Set the plot zoom limit in Y-axis.

Parameters

  minY | Minimum limit in Y-axis.
  maxY | Maximum limit in Y-axis.

The documentation for this class was generated from the following files:

- C:/Users/danie/Documents/GitHub/wxPlot/wxPlot/src/plots/plotfigures/plotfigures.hpp
- C:/Users/danie/Documents/GitHub/wxPlot/wxPlot/src/plots/plotfigures/plotfigures.cpp