PySide6.QtGraphs.QAbstractAxis

class QAbstractAxis

The QAbstractAxis class is a base class used for specialized axis classes. More

Inheritance diagram of PySide6.QtGraphs.QAbstractAxis

Inherited by: QValueAxis, QDateTimeAxis, QBarCategoryAxis

Synopsis

Properties

  • alignmentᅟ - Of the axis

  • gridVisibleᅟ - Visibility of the grid lines. By default, the value is true

  • labelDelegateᅟ - 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

  • labelsAngleᅟ - Angle of the axis labels in degrees

  • labelsVisibleᅟ - Whether axis labels are visible. By default, the value is true

  • lineVisibleᅟ - Visibility of the axis line. By default, the value is true

  • subGridVisibleᅟ - Visibility of the subgrid lines

  • titleColorᅟ - Color used to draw the title text

  • titleFontᅟ - Font of the title of the axis

  • titleTextᅟ - Title of the axis

  • titleVisibleᅟ - Visibility of the axis title

  • visibleᅟ - Visibility of the axis. By default, the value is true

Methods

Virtual methods

Signals

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

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.

class AxisType

This enum type specifies the type of the axis object.

Constant

Description

QAbstractAxis.AxisType.AxisType.Value

QAbstractAxis.AxisType.AxisType.BarCategory

QAbstractAxis.AxisType.AxisType.DateTime

Note

Properties can be used directly when from __feature__ import true_property is used or via accessor functions otherwise.

property alignmentᅟ: Combination of Qt.AlignmentFlag

This property holds The alignment of the axis..

Can be Qt::AlignLeft, Qt::AlignRight, Qt::AlignBottom, or Qt::AlignTop.

Access functions:
property gridVisibleᅟ: bool

This property holds The visibility of the grid lines. By default, the value is true..

Access functions:
property labelDelegateᅟ: QQmlComponent

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:
property labelsAngleᅟ: float

This property holds The angle of the axis labels in degrees..

Access functions:
property labelsVisibleᅟ: bool

This property holds Whether axis labels are visible. By default, the value is true..

Access functions:
property lineVisibleᅟ: bool

This property holds The visibility of the axis line. By default, the value is true..

Access functions:
property subGridVisibleᅟ: bool

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:
property titleColorᅟ: QColor

This property holds The color used to draw the title text..

Access functions:
property titleFontᅟ: QFont

This property holds The font of the title of the axis..

Access functions:
property titleTextᅟ: str

This property holds The title of the axis..

Empty by default. Axis titles support HTML formatting.

Access functions:
property titleVisibleᅟ: bool

This property holds The visibility of the axis title..

By default, the value is true.

Access functions:
property visibleᅟ: bool

This property holds The visibility of the axis. By default, the value is true..

Access functions:
alignment()
Return type:

Combination of AlignmentFlag

See also

setAlignment()

Getter of property alignmentᅟ .

alignmentChanged(alignment)
Parameters:

alignment – Combination of AlignmentFlag

Notification signal of property alignmentᅟ .

gridVisibleChanged(visible)
Parameters:

visible – bool

Notification signal of property gridVisibleᅟ .

hide()

Makes the axis, labels, and grid lines invisible.

isGridVisible()
Return type:

bool

Getter of property gridVisibleᅟ .

isLineVisible()
Return type:

bool

Getter of property lineVisibleᅟ .

isSubGridVisible()
Return type:

bool

Getter of property subGridVisibleᅟ .

isTitleVisible()
Return type:

bool

Getter of property titleVisibleᅟ .

isVisible()
Return type:

bool

Getter of property visibleᅟ .

labelDelegate()
Return type:

QQmlComponent

Getter of property labelDelegateᅟ .

labelDelegateChanged()

Notification signal of property labelDelegateᅟ .

labelsAngle()
Return type:

float

See also

setLabelsAngle()

Getter of property labelsAngleᅟ .

labelsAngleChanged(angle)
Parameters:

angle – float

Notification signal of property labelsAngleᅟ .

labelsVisible()
Return type:

bool

Getter of property labelsVisibleᅟ .

labelsVisibleChanged(visible)
Parameters:

visible – bool

Notification signal of property labelsVisibleᅟ .

lineVisibleChanged(visible)
Parameters:

visible – bool

Notification signal of property lineVisibleᅟ .

rangeChanged(min, max)
Parameters:
  • min – float

  • max – float

setAlignment(alignment)
Parameters:

alignment – Combination of AlignmentFlag

See also

alignment()

Setter of property alignmentᅟ .

setGridVisible([visible=true])
Parameters:

visible – bool

See also

isGridVisible()

Setter of property gridVisibleᅟ .

setLabelDelegate(newLabelDelegate)
Parameters:

newLabelDelegateQQmlComponent

See also

labelDelegate()

Setter of property labelDelegateᅟ .

setLabelsAngle(angle)
Parameters:

angle – float

See also

labelsAngle()

Setter of property labelsAngleᅟ .

setLabelsVisible([visible=true])
Parameters:

visible – bool

See also

labelsVisible()

Setter of property labelsVisibleᅟ .

setLineVisible([visible=true])
Parameters:

visible – bool

Determines whether the axis line and tick marks are visible.

See also

isLineVisible()

Setter of property lineVisibleᅟ .

setMax(max)
Parameters:

max – object

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.

setMin(min)
Parameters:

min – object

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.

setRange(min, max)
Parameters:
  • min – object

  • max – object

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.

setSubGridVisible([visible=true])
Parameters:

visible – bool

Setter of property subGridVisibleᅟ .

setTitleColor(color)
Parameters:

colorQColor

Sets the color used to draw titles to color.

See also

titleColor()

Setter of property titleColorᅟ .

setTitleFont(font)
Parameters:

fontQFont

Sets the font used to draw titles to font.

See also

titleFont()

Setter of property titleFontᅟ .

setTitleText(title)
Parameters:

title – str

See also

titleText()

Setter of property titleTextᅟ .

setTitleVisible([visible=true])
Parameters:

visible – bool

See also

isTitleVisible()

Setter of property titleVisibleᅟ .

setVisible([visible=true])
Parameters:

visible – bool

Sets the visibility of the axis, labels, and grid lines to visible.

See also

isVisible()

Setter of property visibleᅟ .

show()

Makes the axis, labels, and grid lines visible.

subGridVisibleChanged(visible)
Parameters:

visible – bool

Notification signal of property subGridVisibleᅟ .

titleColor()
Return type:

QColor

Returns the color used to draw titles.

See also

setTitleColor()

Getter of property titleColorᅟ .

titleColorChanged(color)
Parameters:

colorQColor

Notification signal of property titleColorᅟ .

titleFont()
Return type:

QFont

Returns the font used to draw titles.

See also

setTitleFont()

Getter of property titleFontᅟ .

titleFontChanged(font)
Parameters:

fontQFont

Notification signal of property titleFontᅟ .

titleText()
Return type:

str

See also

setTitleText()

Getter of property titleTextᅟ .

titleTextChanged(title)
Parameters:

title – str

Notification signal of property titleTextᅟ .

titleVisibleChanged(visible)
Parameters:

visible – bool

Notification signal of property titleVisibleᅟ .

abstract type()
Return type:

AxisType

Returns the type of the axis.

update()

This signal is emitted when the axis needs to be updated.

visibleChanged(visible)
Parameters:

visible – bool

Notification signal of property visibleᅟ .