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
17class QCPAxis;
18class QCPBars;
19class QCPGraph;
20class QCustomPlot;
21
22class Graph : public QObject {
23 Q_OBJECT
24public:
25 static const int 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 unsigned int yAxisFactor() const { return y_axis_factor_; }
38 void setYAxisFactor(unsigned int y_axis_factor);
39 QCPGraph* graph() const { return graph_; }
40 QCPBars* bars() const { return bars_; }
41 bool addToLegend();
42 bool setPlotStyle(PlotStyles style);
43
44protected:
45 QCustomPlot* parent_;
46 QCPGraph* graph_;
47 QCPBars* bars_;
48 QString name_;
49 QBrush color_;
50 bool visible_;
51 unsigned int y_axis_factor_;
52
53 void applyCurrentColor();
54 bool removeFromLegend();
55 void clearAllData();
56};
57
58#endif // GRAPH_H
Definition graph.h:22