35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
// SPDX-FileCopyrightText: 2025 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JFJOCH_JFJOCHSIMPLECHARTVIEW_H
|
|
#define JFJOCH_JFJOCHSIMPLECHARTVIEW_H
|
|
|
|
#include <QtCharts/QChartView>
|
|
#include <QtCharts/QValueAxis>
|
|
#include <QtCharts/QLineSeries>
|
|
|
|
class JFJochSimpleChartView : public QChartView {
|
|
Q_OBJECT
|
|
bool one_over_d = false;
|
|
signals:
|
|
void writeStatusBar(QString string, int timeout_ms = 0);
|
|
|
|
protected:
|
|
QLineSeries *m_series = nullptr;
|
|
QGraphicsLineItem *m_hoverLine = nullptr;
|
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
|
void leaveEvent(QEvent *event) override;
|
|
std::vector<float> x, y;
|
|
virtual QString getText(size_t idx);
|
|
|
|
public:
|
|
JFJochSimpleChartView(QWidget *parent = nullptr);
|
|
virtual void UpdateData(const std::vector<float> &in_x, const std::vector<float> &in_y,
|
|
QString legend_x, QString legend_y, bool one_over_d);
|
|
void ClearData();
|
|
};
|
|
|
|
|
|
#endif //JFJOCH_JFJOCHSIMPLECHARTVIEW_H
|