wxPlot 1.8 Real time plot library for wxWidgets

Loading...
Searching...
No Matches
2Dfigure.hpp
1#pragma once
2
3#include "proportional/proportional.hpp"
4#include "histogram/histogram.hpp"
5#include "../../plottools/plottools.hpp"
6
11 class _2DFigure {
12 private:
13
14 WXPLOT_TYPE wxPlotType = WXPLOT_TYPE_LINE;
15
16 Proportional proportional;
17
18 Histogram histogram;
19
20 public:
21
26 void setWxPlotType(const WXPLOT_TYPE wxPlotType);
27
32 void setFontSize(const unsigned int fontSize);
33
38 void setTitle(const wxString& title);
39
44 void setXlabel(const wxString& xLabel);
45
50 void setYlabel(const wxString& yLabel);
51
56 void setTicks(const unsigned int ticks);
57
62 void gridOn(const bool useGrid);
63
82 void setPlotStartWidth(const wxCoord plotStartWidth);
83
102 void setPlotStartHeight(const wxCoord plotStartHeight);
103
122 void setPlotEndWidth(const wxCoord plotEndWidth);
123
142 void setPlotEndHeight(const wxCoord plotEndHeight);
143
148 void setData(const std::vector<std::vector<double>>& data2D);
149
154 void setData(const std::vector<double>& data1D);
155
160 void legendOn(const bool useLegend);
161
167 void setLegend(const std::vector<wxString>& legend, const PLACEMENT legendPosition = PLACEMENT_NORTH_EAST);
168
173 void setBinCount(const unsigned int binCount);
174
180 void setYlim(const double minY, const double maxY);
181
187 wxCoord getPlotStartWidth() const;
188
194 wxCoord getPlotEndWidth() const;
195
201 wxCoord getPlotStartHeight() const;
202
208 wxCoord getPlotEndHeight() const;
209
220 void drawFigure(wxDC& dc);
221
227 void drawGrid(wxDC& dc);
228
234 void drawTicks(wxDC& dc);
235
241 void drawLegend(wxDC& dc);
242};
_2DFigure
This is the 2D plot figure class. It contains plot figures such as propotional, histogram etc.
Definition 2Dfigure.hpp:11
_2DFigure::setLegend
void setLegend(const std::vector< wxString > &legend, const PLACEMENT legendPosition=PLACEMENT_NORTH_EAST)
Set the labels and placement for the legend.
Definition 2Dfigure.cpp:91
_2DFigure::getPlotEndHeight
wxCoord getPlotEndHeight() const
Get the recalculated end height Y-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:176
_2DFigure::setPlotEndWidth
void setPlotEndWidth(const wxCoord plotEndWidth)
Set the right upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is r...
Definition 2Dfigure.cpp:44
_2DFigure::setXlabel
void setXlabel(const wxString &xLabel)
Set the name of the X-label.
Definition 2Dfigure.cpp:14
_2DFigure::setTicks
void setTicks(const unsigned int ticks)
Set the number of ticks at the figure in all axis.
Definition 2Dfigure.cpp:24
_2DFigure::setData
void setData(const std::vector< std::vector< double > > &data2D)
Set 2D data.
Definition 2Dfigure.cpp:54
_2DFigure::setPlotStartWidth
void setPlotStartWidth(const wxCoord plotStartWidth)
Set the left upper corner in X-axis. Inside this rectangle, the plot is drawn. NOTE: This value is re...
Definition 2Dfigure.cpp:34
_2DFigure::setBinCount
void setBinCount(const unsigned int binCount)
Set the bin count for e.g. histogram.
Definition 2Dfigure.cpp:106
_2DFigure::getPlotStartWidth
wxCoord getPlotStartWidth() const
Get the recalculated start width X-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:110
_2DFigure::setFontSize
void setFontSize(const unsigned int fontSize)
Set the size of the fonts.
Definition 2Dfigure.cpp:96
_2DFigure::setWxPlotType
void setWxPlotType(const WXPLOT_TYPE wxPlotType)
Set the plot type selection.
Definition 2Dfigure.cpp:3
_2DFigure::drawTicks
void drawTicks(wxDC &dc)
This function will draw the ticks. Call this function after you have drawn the plot type.
Definition 2Dfigure.cpp:227
_2DFigure::drawFigure
void drawFigure(wxDC &dc)
This function will do the following:
Definition 2Dfigure.cpp:198
_2DFigure::legendOn
void legendOn(const bool useLegend)
Activate the legend.
Definition 2Dfigure.cpp:86
_2DFigure::setPlotStartHeight
void setPlotStartHeight(const wxCoord plotStartHeight)
Set the left upper corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is re...
Definition 2Dfigure.cpp:39
_2DFigure::drawLegend
void drawLegend(wxDC &dc)
This function will draw the legend. Call this function after you have drawn the plot type.
Definition 2Dfigure.cpp:279
_2DFigure::getPlotEndWidth
wxCoord getPlotEndWidth() const
Get the recalculated end width X-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:132
_2DFigure::drawGrid
void drawGrid(wxDC &dc)
This function will draw the grid. Call this function after you have drawn the plot type.
Definition 2Dfigure.cpp:253
_2DFigure::setYlabel
void setYlabel(const wxString &yLabel)
Set the name of the Y-label.
Definition 2Dfigure.cpp:19
_2DFigure::setTitle
void setTitle(const wxString &title)
Set the title of the plot.
Definition 2Dfigure.cpp:9
_2DFigure::getPlotStartHeight
wxCoord getPlotStartHeight() const
Get the recalculated start height Y-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:154
_2DFigure::setPlotEndHeight
void setPlotEndHeight(const wxCoord plotEndHeight)
Set the right bottom corner in Y-axis. Inside this rectangle, the plot is drawn. NOTE: This value is ...
Definition 2Dfigure.cpp:49
_2DFigure::setYlim
void setYlim(const double minY, const double maxY)
Set the plot zoom limit in Y-axis.
Definition 2Dfigure.cpp:101
_2DFigure::gridOn
void gridOn(const bool useGrid)
Enable grid on the figure.
Definition 2Dfigure.cpp:29
Histogram
Histogram class. Inheritance from class Proportional.
Definition histogram.hpp:13
Proportional
Proportional class. Do the most work in all 2D plot figures.
Definition proportional.hpp:12