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
11class _2DFigure {
12private:
13
14 WXPLOT_TYPE wxPlotType = WXPLOT_TYPE_LINE;
15
16 Proportional proportional;
17
18 Histogram histogram;
19
20public:
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};
This is the 2D plot figure class. It contains plot figures such as propotional, histogram etc.
Definition 2Dfigure.hpp:11
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
wxCoord getPlotEndHeight() const
Get the recalculated end height Y-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:176
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
void setXlabel(const wxString &xLabel)
Set the name of the X-label.
Definition 2Dfigure.cpp:14
void setTicks(const unsigned int ticks)
Set the number of ticks at the figure in all axis.
Definition 2Dfigure.cpp:24
void setData(const std::vector< std::vector< double > > &data2D)
Set 2D data.
Definition 2Dfigure.cpp:54
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
void setBinCount(const unsigned int binCount)
Set the bin count for e.g. histogram.
Definition 2Dfigure.cpp:106
wxCoord getPlotStartWidth() const
Get the recalculated start width X-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:110
void setFontSize(const unsigned int fontSize)
Set the size of the fonts.
Definition 2Dfigure.cpp:96
void setWxPlotType(const WXPLOT_TYPE wxPlotType)
Set the plot type selection.
Definition 2Dfigure.cpp:3
void drawTicks(wxDC &dc)
This function will draw the ticks. Call this function after you have drawn the plot type.
Definition 2Dfigure.cpp:227
void drawFigure(wxDC &dc)
This function will do the following:
Definition 2Dfigure.cpp:198
void legendOn(const bool useLegend)
Activate the legend.
Definition 2Dfigure.cpp:86
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
void drawLegend(wxDC &dc)
This function will draw the legend. Call this function after you have drawn the plot type.
Definition 2Dfigure.cpp:279
wxCoord getPlotEndWidth() const
Get the recalculated end width X-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:132
void drawGrid(wxDC &dc)
This function will draw the grid. Call this function after you have drawn the plot type.
Definition 2Dfigure.cpp:253
void setYlabel(const wxString &yLabel)
Set the name of the Y-label.
Definition 2Dfigure.cpp:19
void setTitle(const wxString &title)
Set the title of the plot.
Definition 2Dfigure.cpp:9
wxCoord getPlotStartHeight() const
Get the recalculated start height Y-axis value. This value is recalculated after the figure is drawn.
Definition 2Dfigure.cpp:154
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
void setYlim(const double minY, const double maxY)
Set the plot zoom limit in Y-axis.
Definition 2Dfigure.cpp:101
void gridOn(const bool useGrid)
Enable grid on the figure.
Definition 2Dfigure.cpp:29
Histogram class. Inheritance from class Proportional.
Definition histogram.hpp:13
Proportional class. Do the most work in all 2D plot figures.
Definition proportional.hpp:12