v2.0.0
Loading...
Searching...
No Matches
DISPLIB::LinePlot Class Reference

Line Plot. More...

#include <lineplot.h>

Public Types

typedef QSharedPointer< LinePlotSPtr
typedef QSharedPointer< const LinePlotConstSPtr

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

Detailed Description

Line Plot.

Line Plot using QPainter

Definition at line 80 of file lineplot.h.

Inheritance diagram for DISPLIB::LinePlot:
Inheritance graph

Member Typedef Documentation

◆ ConstSPtr

typedef QSharedPointer<const LinePlot> DISPLIB::LinePlot::ConstSPtr

Const shared pointer type for LinePlot.

Definition at line 86 of file lineplot.h.

◆ SPtr

typedef QSharedPointer<LinePlot> DISPLIB::LinePlot::SPtr

Shared pointer type for LinePlot.

Definition at line 85 of file lineplot.h.

Constructor & Destructor Documentation

◆ LinePlot() [1/3]

LinePlot::LinePlot ( QWidget * parent = nullptr)

Constructs a line series plot

Parameters
[in]parentIf parent is nullptr, the new widget becomes a window.

Definition at line 65 of file lineplot.cpp.

◆ LinePlot() [2/3]

LinePlot::LinePlot ( const QVector< double > & y,
const QString & title = "",
QWidget * parent = nullptr )

Constructs a line series plot

Parameters
[in]yThe double data vector.
[in]titlePlot title.
[in]parentIf parent is nullptr, the new widget becomes a window.

Definition at line 79 of file lineplot.cpp.

◆ LinePlot() [3/3]

LinePlot::LinePlot ( const QVector< double > & x,
const QVector< double > & y,
const QString & title = "",
QWidget * parent = nullptr )

Constructs a line series plot

Parameters
[in]xX-Axis data to plot.
[in]yY-Axis data to plot.
[in]titlePlot title.
[in]parentIf parent is nullptr, the new widget becomes a window.

Definition at line 97 of file lineplot.cpp.

◆ ~LinePlot()

LinePlot::~LinePlot ( )
virtual

Destructs the line series plot

Definition at line 116 of file lineplot.cpp.

Member Function Documentation

◆ paintEvent()

void LinePlot::paintEvent ( QPaintEvent * event)
overrideprotected

Paints the line plot.

Parameters
[in]eventThe paint event.

Definition at line 187 of file lineplot.cpp.

◆ setTitle()

void LinePlot::setTitle ( const QString & p_sTitle)

Sets the plot title.

Parameters
[in]p_sTitleThe title.

Definition at line 122 of file lineplot.cpp.

◆ setXLabel()

void LinePlot::setXLabel ( const QString & p_sXLabel)

Sets the label of the x axis

Parameters
[in]p_sXLabelThe x axis label.

Definition at line 130 of file lineplot.cpp.

◆ setYLabel()

void LinePlot::setYLabel ( const QString & p_sYLabel)

Sets the label of the y axis

Parameters
[in]p_sYLabelThe y axis label.

Definition at line 138 of file lineplot.cpp.

◆ updateData() [1/2]

void LinePlot::updateData ( const QVector< double > & x,
const QVector< double > & y )

Updates the plot using the given vectors.

Parameters
[in]xX-Axis data to plot.
[in]yY-Axis data to plot.

Definition at line 157 of file lineplot.cpp.

◆ updateData() [2/2]

void LinePlot::updateData ( const QVector< double > & y)

Updates the plot using a given double vector without given X data.

Parameters
[in]yThe double data vector.

Definition at line 146 of file lineplot.cpp.


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