nngn
Loading...
Searching...
No Matches
graph.h
Go to the documentation of this file.
1#ifndef NNGN_TOOLS_TIMELINE_GRAPH_H
2#define NNGN_TOOLS_TIMELINE_GRAPH_H
3
4#include <vector>
5#include <QVector>
6#include <QtCharts/QChartView>
7
8namespace QtCharts { class QLineSeries; }
9
10class Graph : public QtCharts::QChartView {
11 Q_OBJECT
12public:
13 enum class Mode { ABSOLUTE, RELATIVE };
15 Graph(Graph&) = delete;
16 Graph &operator=(Graph&) = delete;
17 Mode mode() const { return this->m_mode; }
18public slots:
19 void new_graph(QString title);
20 void new_data(const QVector<qreal> &v);
21 void set_mode(Mode m) { this->m_mode = m; }
22private:
23 using QLineSeries = QtCharts::QLineSeries;
24 std::vector<QLineSeries*> series = {};
25 Mode m_mode = Mode::RELATIVE;
26};
27
28#endif
m
Definition: input.lua:23
v[1]
Definition: math.lua:19
Definition: window.h:10
Definition: graph.h:4
std::vector< QLineSeries * > series
Definition: graph.h:24
void new_data(const QVector< qreal > &v)
Mode m_mode
Definition: graph.h:25
void set_mode(Mode m)
Definition: graph.h:21
Graph & operator=(Graph &)=delete
Graph(Graph &)=delete
QtCharts::QLineSeries QLineSeries
Definition: graph.h:23
Mode
Definition: graph.h:13
void new_graph(QString title)
Mode mode() const
Definition: graph.h:17
TerminalMode
Definition: graphics.h:163