#ifndef CHANNELCHARTFORM_H
#define CHANNELCHARTFORM_H

#include <QWidget>
#include "qcustomplot.h"
#include "common/LinearRegression.h"
#include "common/utils/SettingConfig.h"

namespace Ui {
class ChannelChartForm;
}

class ChannelChartForm : public QWidget
{
    Q_OBJECT

public:
    explicit ChannelChartForm(QWidget *parent = nullptr);
    ~ChannelChartForm();

    void setTitleText(QString titleText);
    void initDataChart(QList<QStringList> hisDataVect);

private slots:
    void on_btnChartClose_clicked();

    void mouseMoveEvent(QMouseEvent *event);
    void showTracerResidual(QMouseEvent *event);

private:
    Ui::ChannelChartForm *ui;
    QCPItemTracer *tracer;
    QCPItemText *tracerLabel;

    QCPItemTracer *tracerResi;
    QCPItemText *tracerResiLabel;

    void drawPlotTracer(qulonglong x);
};

#endif // CHANNELCHARTFORM_H
