| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
graph.h
Go to the documentation of this file.
1
10#ifndef GRAPH_H
11#define GRAPH_H
12
13#include <config.h>
14
15#include "wireshark_dialog.h"
16
17 class QCPAxis;
18 class QCPBars;
19 class QCPGraph;
20 class QCustomPlot;
21
22 class Graph : public QObject {
23 Q_OBJECT
24 public:
25 static constexpr double default_y_axis_factor_ = 1;
26 const qreal graph_line_width_ = 1.0;
27 enum PlotStyles { psLine, psDotLine, psStepLine, psDotStepLine, psImpulse, psBar, psStackedBar, psDot, psSquare, psDiamond, psCross, psPlus, psCircle };
28
29 explicit Graph(QCustomPlot* parent, QCPAxis* keyAxis = nullptr, QCPAxis* valueAxis = nullptr);
30 ~Graph();
31 QString name() const { return name_; }
32 void setName(const QString& name);
33 QRgb color() const;
34 void setColor(const QRgb color);
35 bool visible() const { return visible_; }
36 void setVisible(bool visible);
37 double yAxisFactor() const { return y_axis_factor_; }
38 void setYAxisFactor(double y_axis_factor);
39 QCPGraph* graph() const { return graph_; }
40 QCPBars* bars() const { return bars_; }
41 bool addToLegend();
42 bool setPlotStyle(PlotStyles style);
43
44 protected:
45 QCustomPlot* parent_;
46 QCPGraph* graph_;
47 QCPBars* bars_;
48 QString name_;
49 QBrush color_;
50 bool visible_;
51 double y_axis_factor_;
52
53 void applyCurrentColor();
54 bool removeFromLegend();
55 void clearAllData();
56};
57
58#endif // GRAPH_H
Graph
Definition graph.h:22
wireshark_dialog.h