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 };
14 Graph();
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
Definition window.h:10
local m
Definition input.lua:28
v[1]
Definition math.lua:22
Definition graph.h:4
void new_data(const QVector< qreal > &v)
Definition graph.cpp:42
Mode m_mode
Definition graph.h:25
std::vector< QLineSeries * > series
Definition graph.h:24
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)
Definition graph.cpp:22
Graph()
Definition graph.cpp:13
Mode mode() const
Definition graph.h:17