The QAbstractAxis class is a base class used for specialized axis classes. More...
| Header: | #include <QAbstractAxis> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs)target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| In QML: | AbstractAxis |
| Inherits: | QObject |
| Inherited By: |
| enum class | AxisType { Value, BarCategory, DateTime } |
|
|
| virtual | ~QAbstractAxis() override |
| void | hide() |
| bool | isGridVisible() const |
| bool | isLineVisible() const |
| bool | isSubGridVisible() const |
| bool | isTitleVisible() const |
| bool | isVisible() const |
| QQmlComponent * | labelDelegate() const |
| qreal | labelsAngle() const |
| bool | labelsVisible() const |
| void | setGridVisible(bool visible = true) |
| void | setLabelDelegate(QQmlComponent *newLabelDelegate) |
| void | setLabelsAngle(qreal angle) |
| void | setLabelsVisible(bool visible = true) |
| void | setLineVisible(bool visible = true) |
| void | setMax(const QVariant &max) |
| void | setMin(const QVariant &min) |
| void | setRange(const QVariant &min, const QVariant &max) |
| void | setSubGridVisible(bool visible = true) |
| void | setTitleColor(QColor color) |
| void | setTitleFont(const QFont &font) |
| void | setTitleText(const QString &title) |
| void | setTitleVisible(bool visible = true) |
| void | setVisible(bool visible = true) |
| void | show() |
| QColor | titleColor() const |
| QFont | titleFont() const |
| QString | titleText() const |
| virtual QAbstractAxis::AxisType | type() const = 0 |
| void | gridVisibleChanged(bool visible) |
| void | labelDelegateChanged() |
| void | labelsAngleChanged(qreal angle) |
| void | labelsVisibleChanged(bool visible) |
| void | lineVisibleChanged(bool visible) |
| void | subGridVisibleChanged(bool visible) |
| void | titleColorChanged(QColor color) |
| void | titleFontChanged(const QFont &font) |
| void | titleTextChanged(const QString &title) |
| void | titleVisibleChanged(bool visible) |
| void | update() |
| void | visibleChanged(bool visible) |
Each series can be bound to only one horizontal and vertical axis.
The properties and visibility of various axis elements, such as axis line, title, labels, and grid lines, can be individually controlled.
This enum type specifies the type of the axis object.
| Constant | Value |
|---|---|
QAbstractAxis::AxisType::Value |
0 |
QAbstractAxis::AxisType::BarCategory |
1 |
QAbstractAxis::AxisType::DateTime |
2 |
This property holds the visibility of the grid lines. By default, the value is true.
Access functions:
| bool | isGridVisible() const |
| void | setGridVisible(bool visible = true) |
Notifier signal:
| void | gridVisibleChanged(bool visible) |
This property holds a custom QML Component used as a label for the axis. This component should either be a Text component or contain "property string text", so that this property will be assigned the value of the label.
Access functions:
| QQmlComponent * | labelDelegate() const |
| void | setLabelDelegate(QQmlComponent *newLabelDelegate) |
Notifier signal:
| void | labelDelegateChanged() |
This property holds the angle of the axis labels in degrees.
Access functions:
| qreal | labelsAngle() const |
| void | setLabelsAngle(qreal angle) |
Notifier signal:
| void | labelsAngleChanged(qreal angle) |
This property holds whether axis labels are visible. By default, the value is true.
Access functions:
| bool | labelsVisible() const |
| void | setLabelsVisible(bool visible = true) |
Notifier signal:
| void | labelsVisibleChanged(bool visible) |
This property holds the visibility of the axis line. By default, the value is true.
Access functions:
| bool | isLineVisible() const |
| void | setLineVisible(bool visible = true) |
Notifier signal:
| void | lineVisibleChanged(bool visible) |
This property holds the visibility of the subgrid lines.
Applies only to axes that support subgrid lines. By default, the value is true.
Access functions:
| bool | isSubGridVisible() const |
| void | setSubGridVisible(bool visible = true) |
Notifier signal:
| void | subGridVisibleChanged(bool visible) |
This property holds the color used to draw the title text.
Access functions:
| QColor | titleColor() const |
| void | setTitleColor(QColor color) |
Notifier signal:
| void | titleColorChanged(QColor color) |
This property holds the font of the title of the axis.
Access functions:
| QFont | titleFont() const |
| void | setTitleFont(const QFont &font) |
Notifier signal:
| void | titleFontChanged(const QFont &font) |
This property holds the title of the axis.
Empty by default. Axis titles support HTML formatting.
Access functions:
| QString | titleText() const |
| void | setTitleText(const QString &title) |
Notifier signal:
| void | titleTextChanged(const QString &title) |
This property holds the visibility of the axis title.
By default, the value is true.
Access functions:
| bool | isTitleVisible() const |
| void | setTitleVisible(bool visible = true) |
Notifier signal:
| void | titleVisibleChanged(bool visible) |
This property holds the visibility of the axis. By default, the value is true.
Access functions:
| bool | isVisible() const |
| void | setVisible(bool visible = true) |
Notifier signal:
| void | visibleChanged(bool visible) |
[override virtual noexcept] QAbstractAxis::~QAbstractAxis()Destructs the axis object. When the axis is added to a graph, the graph object takes ownership.
Makes the axis, labels, and grid lines invisible.
Determines whether the axis line and tick marks are visible.
Note: Setter function for property lineVisible.
See also isLineVisible().
Sets the maximum value shown on the axis. Depending on the actual axis type, the max parameter is converted to the appropriate type of value. If the conversion is impossible, the function call does nothing.
Sets the minimum value shown on the axis. Depending on the actual axis type, the min parameter is converted to the appropriate type of value. If the conversion is impossible, the function call does nothing.
Sets the range shown on the axis. Depending on the actual axis type, the min and max parameters are converted to appropriate types of values. If the conversion is impossible, the function call does nothing.
Sets the color used to draw titles to color.
Note: Setter function for property titleColor.
See also titleColor().
Sets the font used to draw titles to font.
Note: Setter function for property titleFont.
See also titleFont().
Sets the visibility of the axis, labels, and grid lines to visible.
Note: Setter function for property visible.
See also isVisible().
Makes the axis, labels, and grid lines visible.
Returns the color used to draw titles.
Note: Getter function for property titleColor.
See also setTitleColor().
Returns the font used to draw titles.
Note: Getter function for property titleFont.
See also setTitleFont().
[pure virtual] QAbstractAxis::AxisType
QAbstractAxis::type() constReturns the type of the axis.
[signal] void QAbstractAxis::update()This signal is emitted when the axis needs to be updated.