55 using namespace Eigen;
64 , m_pLineSeries(Q_NULLPTR)
77 , m_pLineSeries(Q_NULLPTR)
86 const QVector<double> &y,
91 , m_pLineSeries(Q_NULLPTR)
115 m_sXLabel = p_sXLabel;
123 m_sYLabel = p_sYLabel;
131 QVector<double> x(y.size());
133 for(
int i = 0; i < x.size(); ++i) {
143 const QVector<double> &y)
146 m_pLineSeries =
new QLineSeries;
149 m_pLineSeries->clear();
152 for(
int i = 0; i < x.size(); ++i) {
153 m_pLineSeries->append(x[i], y[i]);
157 m_pChart =
new QChart;
160 m_pChart->removeAllSeries();
163 m_pChart->legend()->hide();
164 m_pChart->addSeries(m_pLineSeries);
165 m_pChart->createDefaultAxes();
172 void LinePlot::update()
177 m_pChart->setTitle(m_sTitle);
179 this->setChart(m_pChart);
180 this->setRenderHint(QPainter::Antialiasing);
181 this->setWindowTitle(m_sTitle);
void setYLabel(const QString &p_sYLabel)
void setTitle(const QString &p_sTitle)
LinePlot(QWidget *parent=Q_NULLPTR)
void updateData(const QVector< double > &y)
void setXLabel(const QString &p_sXLabel)
LinePlot class declaration.