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 static const int default_y_axis_factor_ = 1;
25 const qreal graph_line_width_ = 1.0;
26 enum PlotStyles { psLine, psDotLine, psStepLine, psDotStepLine, psImpulse, psBar, psStackedBar, psDot, psSquare, psDiamond, psCross, psPlus, psCircle };
27
28 explicit Graph(QCustomPlot* parent);
29 ~Graph();
30 QString name() const { return name_; }
31 void setName(const QString& name);
32 QRgb color() const;
33 void setColor(const QRgb color);
34 bool visible() const { return visible_; }
35 void setVisible(bool visible);
36 unsigned int yAxisFactor() const { return y_axis_factor_; }
37 void setYAxisFactor(unsigned int y_axis_factor);
38 QCPGraph* graph() const { return graph_; }
39 QCPBars* bars() const { return bars_; }
40 bool addToLegend();
41 bool setPlotStyle(PlotStyles style);
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
52 void applyCurrentColor();
53 bool removeFromLegend();
54 void clearAllData();
55};
56
57#endif // GRAPH_H
Definition graph.h:21