Wireshark 4.5.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 QCPBars;
18class QCPGraph;
19class QCustomPlot;
20
21class Graph : public QObject {
22 Q_OBJECT
23public:
24 const qreal graph_line_width_ = 1.0;
25 enum PlotStyles { psLine, psDotLine, psStepLine, psDotStepLine, psImpulse, psBar, psStackedBar, psDot, psSquare, psDiamond, psCross, psPlus, psCircle };
26
27 explicit Graph(QCustomPlot* parent);
28 ~Graph();
29 QString name() const { return name_; }
30 void setName(const QString& name);
31 QRgb color() const;
32 void setColor(const QRgb color);
33 bool visible() const { return visible_; }
34 void setVisible(bool visible);
35 unsigned int yAxisFactor() const { return y_axis_factor_; }
36 void setYAxisFactor(unsigned int y_axis_factor);
37 QCPGraph* graph() const { return graph_; }
38 QCPBars* bars() const { return bars_; }
39 bool addToLegend();
40 bool setPlotStyle(PlotStyles style);
41 nstime_t startTime() const;
42
43protected:
44 QCustomPlot* parent_;
45 QCPGraph* graph_;
46 QCPBars* bars_;
47 QString name_;
48 QBrush color_;
49 bool visible_;
50 unsigned int y_axis_factor_;
51 nstime_t start_time_;
52
53 void applyCurrentColor();
54 bool removeFromLegend();
55 void clearAllData();
56 double startOffset() const;
57};
58
59#endif // GRAPH_H
Definition graph.h:21
Definition nstime.h:26