Represents a single data graph within a QCustomPlot, managing its data, visual style, and axes mapping.
More...
#include <graph.h>
|
| enum | PlotStyles {
psLine
, psDotLine
, psStepLine
, psDotStepLine
,
psImpulse
, psBar
, psStackedBar
, psDot
,
psSquare
, psDiamond
, psCross
, psPlus
,
psCircle
} |
| | Defines the available visual styles for plotting data. More...
|
| |
|
| | Graph (QCustomPlot *parent, QCPAxis *keyAxis=nullptr, QCPAxis *valueAxis=nullptr) |
| | Constructs a new Graph.
|
| |
|
| ~Graph () |
| | Destroys the Graph.
|
| |
| QString | name () const |
| | Retrieves the name of the graph.
|
| |
| void | setName (const QString &name) |
| | Sets the name of the graph.
|
| |
| QRgb | color () const |
| | Retrieves the color of the graph.
|
| |
| void | setColor (const QRgb color) |
| | Sets the color of the graph.
|
| |
| bool | visible () const |
| | Checks if the graph is currently visible.
|
| |
| void | setVisible (bool visible) |
| | Sets the visibility of the graph.
|
| |
| double | yAxisFactor () const |
| | Retrieves the scaling factor for the Y-axis.
|
| |
| void | setYAxisFactor (double y_axis_factor) |
| | Sets the scaling factor for the Y-axis.
|
| |
| QCPGraph * | graph () const |
| | Retrieves the underlying QCPGraph object.
|
| |
| QCPBars * | bars () const |
| | Retrieves the underlying QCPBars object.
|
| |
| bool | addToLegend () |
| | Adds the graph to the parent plot's legend.
|
| |
| bool | setPlotStyle (PlotStyles style) |
| | Sets the visual style of the plot.
|
| |
|
|
void | applyCurrentColor () |
| | Applies the currently set color to the underlying graphical elements.
|
| |
| bool | removeFromLegend () |
| | Removes the graph from the parent plot's legend.
|
| |
|
void | clearAllData () |
| | Clears all data points currently loaded into the graph.
|
| |
Represents a single data graph within a QCustomPlot, managing its data, visual style, and axes mapping.
◆ PlotStyles
Defines the available visual styles for plotting data.
| Enumerator |
|---|
| psLine | Continuous line plot.
|
| psDotLine | Dotted line plot.
|
| psStepLine | Step line plot.
|
| psDotStepLine | Dotted step line plot.
|
| psImpulse | Impulse (stem) plot.
|
| psBar | Bar chart.
|
| psStackedBar | Stacked bar chart.
|
| psDot | Data points as dots.
|
| psSquare | Data points as squares.
|
| psDiamond | Data points as diamonds.
|
| psCross | Data points as crosses (x).
|
| psPlus | Data points as plus signs (+).
|
| psCircle | Data points as circles.
|
◆ Graph()
| Graph::Graph |
( |
QCustomPlot * |
parent, |
|
|
QCPAxis * |
keyAxis = nullptr, |
|
|
QCPAxis * |
valueAxis = nullptr |
|
) |
| |
|
explicit |
Constructs a new Graph.
- Parameters
-
| parent | The parent QCustomPlot widget. |
| keyAxis | The axis to use for key (X) coordinates (defaults to nullptr). |
| valueAxis | The axis to use for value (Y) coordinates (defaults to nullptr). |
◆ addToLegend()
| bool Graph::addToLegend |
( |
| ) |
|
Adds the graph to the parent plot's legend.
- Returns
- True if successfully added, false otherwise.
◆ bars()
| QCPBars * Graph::bars |
( |
| ) |
const |
|
inline |
Retrieves the underlying QCPBars object.
- Returns
- A pointer to the QCPBars instance.
◆ color()
| QRgb Graph::color |
( |
| ) |
const |
Retrieves the color of the graph.
- Returns
- The QRgb color value.
◆ graph()
| QCPGraph * Graph::graph |
( |
| ) |
const |
|
inline |
Retrieves the underlying QCPGraph object.
- Returns
- A pointer to the QCPGraph instance.
◆ name()
| QString Graph::name |
( |
| ) |
const |
|
inline |
Retrieves the name of the graph.
- Returns
- The graph name.
◆ removeFromLegend()
| bool Graph::removeFromLegend |
( |
| ) |
|
|
protected |
Removes the graph from the parent plot's legend.
- Returns
- True if successfully removed, false otherwise.
◆ setColor()
| void Graph::setColor |
( |
const QRgb |
color | ) |
|
Sets the color of the graph.
- Parameters
-
| color | The new QRgb color value. |
◆ setName()
| void Graph::setName |
( |
const QString & |
name | ) |
|
Sets the name of the graph.
- Parameters
-
◆ setPlotStyle()
Sets the visual style of the plot.
- Parameters
-
| style | The PlotStyles enum value to apply. |
- Returns
- True if the style was successfully applied, false otherwise.
◆ setVisible()
| void Graph::setVisible |
( |
bool |
visible | ) |
|
Sets the visibility of the graph.
- Parameters
-
| visible | True to show the graph, false to hide it. |
◆ setYAxisFactor()
| void Graph::setYAxisFactor |
( |
double |
y_axis_factor | ) |
|
Sets the scaling factor for the Y-axis.
- Parameters
-
| y_axis_factor | The new scaling factor. |
◆ visible()
| bool Graph::visible |
( |
| ) |
const |
|
inline |
Checks if the graph is currently visible.
- Returns
- True if visible, false otherwise.
◆ yAxisFactor()
| double Graph::yAxisFactor |
( |
| ) |
const |
|
inline |
Retrieves the scaling factor for the Y-axis.
- Returns
- The Y-axis factor.
◆ bars_
Pointer to the underlying QCPBars instance.
◆ color_
The brush color of the graph.
◆ default_y_axis_factor_
| constexpr double Graph::default_y_axis_factor_ = 1 |
|
staticconstexpr |
The default multiplication factor applied to the Y-axis.
◆ graph_
Pointer to the underlying QCPGraph instance.
◆ graph_line_width_
| const qreal Graph::graph_line_width_ = 1.0 |
The default line width used when drawing the graph.
◆ name_
◆ parent_
| QCustomPlot* Graph::parent_ |
|
protected |
Pointer to the parent QCustomPlot widget.
◆ visible_
Flag indicating whether the graph is currently visible.
◆ y_axis_factor_
| double Graph::y_axis_factor_ |
|
protected |
The scaling factor applied to the Y-axis.
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/graph.h
- /builds/wireshark/wireshark/ui/qt/graph.cpp