Simple x / y line-series QWidget rendered with QPainter (no Qt Charts dependency). More...
#include <lineplot.h>
Public Types | |
| typedef QSharedPointer< LinePlot > | SPtr |
| typedef QSharedPointer< const LinePlot > | ConstSPtr |
Public Member Functions | |
| LinePlot (QWidget *parent=nullptr) | |
| LinePlot (const QVector< double > &y, const QString &title="", QWidget *parent=nullptr) | |
| LinePlot (const QVector< double > &x, const QVector< double > &y, const QString &title="", QWidget *parent=nullptr) | |
| virtual | ~LinePlot () |
| void | setTitle (const QString &p_sTitle) |
| void | setXLabel (const QString &p_sXLabel) |
| void | setYLabel (const QString &p_sYLabel) |
| void | updateData (const QVector< double > &y) |
| void | updateData (const QVector< double > &x, const QVector< double > &y) |
Protected Member Functions | |
| void | paintEvent (QPaintEvent *event) override |
Simple x / y line-series QWidget rendered with QPainter (no Qt Charts dependency).
Supports multiple series, a settable title and x / y labels and auto-ranging axes. Series are stored as QVector<double> pairs and re-drawn during paintEvent.
Definition at line 70 of file lineplot.h.

| typedef QSharedPointer<const LinePlot> DISPLIB::LinePlot::ConstSPtr |
Const shared pointer type for LinePlot.
Definition at line 76 of file lineplot.h.
| typedef QSharedPointer<LinePlot> DISPLIB::LinePlot::SPtr |
Shared pointer type for LinePlot.
Definition at line 75 of file lineplot.h.
| LinePlot::LinePlot | ( | QWidget * | parent = nullptr | ) |
Constructs a line series plot
| [in] | parent | If parent is nullptr, the new widget becomes a window. |
Definition at line 45 of file lineplot.cpp.
| LinePlot::LinePlot | ( | const QVector< double > & | y, |
| const QString & | title = "", | ||
| QWidget * | parent = nullptr ) |
Constructs a line series plot
| [in] | y | The double data vector. |
| [in] | title | Plot title. |
| [in] | parent | If parent is nullptr, the new widget becomes a window. |
Definition at line 59 of file lineplot.cpp.
| LinePlot::LinePlot | ( | const QVector< double > & | x, |
| const QVector< double > & | y, | ||
| const QString & | title = "", | ||
| QWidget * | parent = nullptr ) |
Constructs a line series plot
| [in] | x | X-Axis data to plot. |
| [in] | y | Y-Axis data to plot. |
| [in] | title | Plot title. |
| [in] | parent | If parent is nullptr, the new widget becomes a window. |
Definition at line 77 of file lineplot.cpp.
|
virtual |
Destructs the line series plot
Definition at line 96 of file lineplot.cpp.
|
overrideprotected |
Paints the line plot.
| [in] | event | The paint event. |
Definition at line 167 of file lineplot.cpp.
| void LinePlot::setTitle | ( | const QString & | p_sTitle | ) |
| void LinePlot::setXLabel | ( | const QString & | p_sXLabel | ) |
Sets the label of the x axis
| [in] | p_sXLabel | The x axis label. |
Definition at line 110 of file lineplot.cpp.
| void LinePlot::setYLabel | ( | const QString & | p_sYLabel | ) |
Sets the label of the y axis
| [in] | p_sYLabel | The y axis label. |
Definition at line 118 of file lineplot.cpp.
| void LinePlot::updateData | ( | const QVector< double > & | x, |
| const QVector< double > & | y ) |
Updates the plot using the given vectors.
| [in] | x | X-Axis data to plot. |
| [in] | y | Y-Axis data to plot. |
Definition at line 137 of file lineplot.cpp.
| void LinePlot::updateData | ( | const QVector< double > & | y | ) |
Updates the plot using a given double vector without given X data.
| [in] | y | The double data vector. |
Definition at line 126 of file lineplot.cpp.