QAbstractAxis#

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

Inheritance diagram of PySide6.QtCharts.QAbstractAxis

Inherited by: QValueAxis, QCategoryAxis, QLogValueAxis, QDateTimeAxis, QBarCategoryAxis

Synopsis#

Properties#

Functions#

Virtual functions#

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 one or more horizontal and vertical axes, but mixing axis types that would result in different domains is not supported, such as specifying QValueAxis and QLogValueAxis on the same orientation.

The properties and visibility of various axis elements, such as axis line, title, labels, grid lines, and shades, can be individually controlled.

class PySide6.QtCharts.QAbstractAxis#

Note

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

property PᅟySide6.QtCharts.QAbstractAxis.alignment: Alignment#

This property holds The alignment of the axis..

Can be AlignLeft , AlignRight , AlignBottom , or AlignTop .

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.color: PySide6.QtGui.QColor#

This property holds The color of the axis and tick marks..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.gridLineColor: PySide6.QtGui.QColor#

This property holds The color of the grid line..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.gridLinePen: PySide6.QtGui.QPen#

This property holds The pen used to draw the grid line..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.gridVisible: bool#

This property holds The visibility of the grid lines..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.labelsAngle: int#

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

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.labelsBrush: PySide6.QtGui.QBrush#

This property holds The brush used to draw the labels..

Only the color of the brush is relevant.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.labelsColor: PySide6.QtGui.QColor#

This property holds The color of the axis labels..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.labelsFont: PySide6.QtGui.QFont#

This property holds The font of the axis labels..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.labelsTruncated: bool#

This property holds Returns true if at least one label on the axis is truncated..

Returned value will not be accurate before the axis is shown.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.labelsVisible: bool#

This property holds Whether axis labels are visible..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.linePen: PySide6.QtGui.QPen#

This property holds The pen used to draw the line..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.lineVisible: bool#

This property holds The visibility of the axis line..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.minorGridLineColor: PySide6.QtGui.QColor#

This property holds The color of the minor grid line..

Applies only to axes that support minor grid lines.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.minorGridLinePen: PySide6.QtGui.QPen#

This property holds The pen used to draw the minor grid line..

Applies only to axes that support minor grid lines.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.minorGridVisible: bool#

This property holds The visibility of the minor grid lines..

Applies only to axes that support minor grid lines.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.orientation: Orientation#

This property holds The orientation of the axis..

Fixed to either Horizontal or Vertical when the axis is added to a chart.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.reverse: bool#

This property holds Whether a reverse axis is used..

By default, the value is false.

The reverse axis is supported with a line, spline, and scatter series, as well as an area series with a cartesian chart. All axes of the same orientation attached to the same series must be reversed if one is reversed or the behavior is undefined.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.shadesBorderColor: PySide6.QtGui.QColor#

This property holds The border (pen) color of the axis shades..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.shadesBrush: PySide6.QtGui.QBrush#

This property holds The brush used to draw the axis shades (the area between the grid lines)..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.shadesColor: PySide6.QtGui.QColor#

This property holds The fill (brush) color of the axis shades..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.shadesPen: PySide6.QtGui.QPen#

This property holds The pen used to draw the axis shades (the area between the grid lines)..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.shadesVisible: bool#

This property holds The visibility of the axis shades..

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.titleBrush: PySide6.QtGui.QBrush#

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

Only the color of the brush is relevant.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.titleFont: PySide6.QtGui.QFont#

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

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.titleText: str#

This property holds The title of the axis..

Empty by default. Axis titles support HTML formatting.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.titleVisible: bool#

This property holds The visibility of the axis title..

By default, the value is true.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.truncateLabels: bool#

This property holds The truncation state of labels..

Indicates whether labels should be truncated if there is no enough space for full text. It is equal to true by default.

Access functions:
property PᅟySide6.QtCharts.QAbstractAxis.visible: bool#

This property holds The visibility of the axis..

Access functions:
PySide6.QtCharts.QAbstractAxis.AxisType#

This enum type specifies the type of the axis object.

Constant

Description

QAbstractAxis.AxisTypeNoAxis

QAbstractAxis.AxisTypeValue

QAbstractAxis.AxisTypeBarCategory

QAbstractAxis.AxisTypeCategory

QAbstractAxis.AxisTypeDateTime

QAbstractAxis.AxisTypeLogValue

QAbstractAxis.AxisTypeColor

PySide6.QtCharts.QAbstractAxis.alignment()#
Return type:

Alignment

Getter of property alignment .

PySide6.QtCharts.QAbstractAxis.colorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the color of the axis changes to color.

Notification signal of property color .

PySide6.QtCharts.QAbstractAxis.gridLineColor()#
Return type:

PySide6.QtGui.QColor

Getter of property gridLineColor .

PySide6.QtCharts.QAbstractAxis.gridLineColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the color of the pen used to draw the grid line changes to color.

Notification signal of property gridLineColor .

PySide6.QtCharts.QAbstractAxis.gridLinePen()#
Return type:

PySide6.QtGui.QPen

Returns the pen used to draw the grid.

See also

setGridLinePen()

Getter of property gridLinePen .

PySide6.QtCharts.QAbstractAxis.gridLinePenChanged(pen)#
Parameters:

penPySide6.QtGui.QPen

This signal is emitted when the pen used to draw the grid line changes to pen.

Notification signal of property gridLinePen .

PySide6.QtCharts.QAbstractAxis.gridVisibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the grid lines of the axis changes to visible.

Notification signal of property gridVisible .

PySide6.QtCharts.QAbstractAxis.hide()#

Makes the axis, shades, labels, and grid lines invisible.

PySide6.QtCharts.QAbstractAxis.isGridLineVisible()#
Return type:

bool

Getter of property gridVisible .

PySide6.QtCharts.QAbstractAxis.isLineVisible()#
Return type:

bool

Getter of property lineVisible .

PySide6.QtCharts.QAbstractAxis.isMinorGridLineVisible()#
Return type:

bool

Getter of property minorGridVisible .

PySide6.QtCharts.QAbstractAxis.isReverse()#
Return type:

bool

Getter of property reverse .

PySide6.QtCharts.QAbstractAxis.isTitleVisible()#
Return type:

bool

Getter of property titleVisible .

PySide6.QtCharts.QAbstractAxis.isVisible()#
Return type:

bool

Getter of property visible .

PySide6.QtCharts.QAbstractAxis.labelsAngle()#
Return type:

int

See also

setLabelsAngle()

Getter of property labelsAngle .

PySide6.QtCharts.QAbstractAxis.labelsAngleChanged(angle)#
Parameters:

angle – int

This signal is emitted when the angle of the axis labels changes to angle.

Notification signal of property labelsAngle .

PySide6.QtCharts.QAbstractAxis.labelsBrush()#
Return type:

PySide6.QtGui.QBrush

Returns the brush used to draw labels.

See also

setLabelsBrush()

Getter of property labelsBrush .

PySide6.QtCharts.QAbstractAxis.labelsBrushChanged(brush)#
Parameters:

brushPySide6.QtGui.QBrush

This signal is emitted when the brush used to draw the axis labels changes to brush.

Notification signal of property labelsBrush .

PySide6.QtCharts.QAbstractAxis.labelsColor()#
Return type:

PySide6.QtGui.QColor

See also

setLabelsColor()

Getter of property labelsColor .

PySide6.QtCharts.QAbstractAxis.labelsColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the color of the axis labels changes to color.

Notification signal of property labelsColor .

PySide6.QtCharts.QAbstractAxis.labelsEditable()#
Return type:

bool

Returns true if axis labels are editable.

PySide6.QtCharts.QAbstractAxis.labelsEditableChanged(editable)#
Parameters:

editable – bool

This signal is emitted when the editable state of the label changes.

PySide6.QtCharts.QAbstractAxis.labelsFont()#
Return type:

PySide6.QtGui.QFont

Returns the font used to draw labels.

See also

setLabelsFont()

Getter of property labelsFont .

PySide6.QtCharts.QAbstractAxis.labelsFontChanged(pen)#
Parameters:

penPySide6.QtGui.QFont

This signal is emitted when the font of the axis labels changes to font.

Notification signal of property labelsFont .

PySide6.QtCharts.QAbstractAxis.labelsTruncated()#
Return type:

bool

Getter of property labelsTruncated .

PySide6.QtCharts.QAbstractAxis.labelsTruncatedChanged(labelsTruncated)#
Parameters:

labelsTruncated – bool

This signal is emitted in two cases; when the axis changes from having one or more truncated labels to having no truncated labels, and when the axis changes from having no truncated labels to having one or more truncated labels. Current state is identified by labelsTruncated.

Notification signal of property labelsTruncated .

PySide6.QtCharts.QAbstractAxis.labelsVisible()#
Return type:

bool

Getter of property labelsVisible .

PySide6.QtCharts.QAbstractAxis.labelsVisibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the labels of the axis changes to visible.

Notification signal of property labelsVisible .

PySide6.QtCharts.QAbstractAxis.linePen()#
Return type:

PySide6.QtGui.QPen

Returns the pen used to draw the axis line and tick marks.

See also

setLinePen()

Getter of property linePen .

PySide6.QtCharts.QAbstractAxis.linePenChanged(pen)#
Parameters:

penPySide6.QtGui.QPen

This signal is emitted when the pen used to draw the line of the axis changes to pen.

Notification signal of property linePen .

PySide6.QtCharts.QAbstractAxis.linePenColor()#
Return type:

PySide6.QtGui.QColor

Getter of property color .

PySide6.QtCharts.QAbstractAxis.lineVisibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the axis line changes to visible.

Notification signal of property lineVisible .

PySide6.QtCharts.QAbstractAxis.minorGridLineColor()#
Return type:

PySide6.QtGui.QColor

Getter of property minorGridLineColor .

PySide6.QtCharts.QAbstractAxis.minorGridLineColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the color of the pen used to draw the minor grid line changes to color.

Notification signal of property minorGridLineColor .

PySide6.QtCharts.QAbstractAxis.minorGridLinePen()#
Return type:

PySide6.QtGui.QPen

Getter of property minorGridLinePen .

PySide6.QtCharts.QAbstractAxis.minorGridLinePenChanged(pen)#
Parameters:

penPySide6.QtGui.QPen

This signal is emitted when the pen used to draw the minor grid line changes to pen.

Notification signal of property minorGridLinePen .

PySide6.QtCharts.QAbstractAxis.minorGridVisibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the minor grid lines of the axis changes to visible.

Notification signal of property minorGridVisible .

PySide6.QtCharts.QAbstractAxis.orientation()#
Return type:

Orientation

Returns the orientation of the axis (vertical or horizontal).

Getter of property orientation .

PySide6.QtCharts.QAbstractAxis.reverseChanged(reverse)#
Parameters:

reverse – bool

Notification signal of property reverse .

PySide6.QtCharts.QAbstractAxis.setGridLineColor(color)#
Parameters:

colorPySide6.QtGui.QColor

See also

gridLineColor()

Setter of property gridLineColor .

PySide6.QtCharts.QAbstractAxis.setGridLinePen(pen)#
Parameters:

penPySide6.QtGui.QPen

Sets the pen used to draw the grid lines to pen.

See also

gridLinePen()

Setter of property gridLinePen .

PySide6.QtCharts.QAbstractAxis.setGridLineVisible([visible=true])#
Parameters:

visible – bool

Setter of property gridVisible .

PySide6.QtCharts.QAbstractAxis.setLabelsAngle(angle)#
Parameters:

angle – int

See also

labelsAngle()

Setter of property labelsAngle .

PySide6.QtCharts.QAbstractAxis.setLabelsBrush(brush)#
Parameters:

brushPySide6.QtGui.QBrush

Sets the brush used to draw labels to brush.

See also

labelsBrush()

Setter of property labelsBrush .

PySide6.QtCharts.QAbstractAxis.setLabelsColor(color)#
Parameters:

colorPySide6.QtGui.QColor

See also

labelsColor()

Setter of property labelsColor .

PySide6.QtCharts.QAbstractAxis.setLabelsEditable([editable=true])#
Parameters:

editable – bool

Sets axis labels editability to editable.

When the labels are editable the user will be able to change the range of the axis conveniently by editing any of the labels. This feature is only supported for the QValueAxis and the QDateTimeAxis .

By default, labels are not editable.

See also

labelsEditable()

PySide6.QtCharts.QAbstractAxis.setLabelsFont(font)#
Parameters:

fontPySide6.QtGui.QFont

Sets the font used to draw labels to font.

See also

labelsFont()

Setter of property labelsFont .

PySide6.QtCharts.QAbstractAxis.setLabelsVisible([visible=true])#
Parameters:

visible – bool

See also

labelsVisible()

Setter of property labelsVisible .

PySide6.QtCharts.QAbstractAxis.setLinePen(pen)#
Parameters:

penPySide6.QtGui.QPen

Sets the pen used to draw the axis line and tick marks to pen.

See also

linePen()

Setter of property linePen .

PySide6.QtCharts.QAbstractAxis.setLinePenColor(color)#
Parameters:

colorPySide6.QtGui.QColor

See also

linePenColor()

Setter of property color .

PySide6.QtCharts.QAbstractAxis.setLineVisible([visible=true])#
Parameters:

visible – bool

Determines whether the axis line and tick marks are visible.

See also

isLineVisible()

Setter of property lineVisible .

PySide6.QtCharts.QAbstractAxis.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.

PySide6.QtCharts.QAbstractAxis.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.

PySide6.QtCharts.QAbstractAxis.setMinorGridLineColor(color)#
Parameters:

colorPySide6.QtGui.QColor

Setter of property minorGridLineColor .

PySide6.QtCharts.QAbstractAxis.setMinorGridLinePen(pen)#
Parameters:

penPySide6.QtGui.QPen

Setter of property minorGridLinePen .

PySide6.QtCharts.QAbstractAxis.setMinorGridLineVisible([visible=true])#
Parameters:

visible – bool

Setter of property minorGridVisible .

PySide6.QtCharts.QAbstractAxis.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.

PySide6.QtCharts.QAbstractAxis.setReverse([reverse=true])#
Parameters:

reverse – bool

See also

isReverse()

Setter of property reverse .

PySide6.QtCharts.QAbstractAxis.setShadesBorderColor(color)#
Parameters:

colorPySide6.QtGui.QColor

Setter of property shadesBorderColor .

PySide6.QtCharts.QAbstractAxis.setShadesBrush(brush)#
Parameters:

brushPySide6.QtGui.QBrush

Sets the brush used to draw shades to brush.

See also

shadesBrush()

Setter of property shadesBrush .

PySide6.QtCharts.QAbstractAxis.setShadesColor(color)#
Parameters:

colorPySide6.QtGui.QColor

See also

shadesColor()

Setter of property shadesColor .

PySide6.QtCharts.QAbstractAxis.setShadesPen(pen)#
Parameters:

penPySide6.QtGui.QPen

Sets the pen used to draw shades to pen.

See also

shadesPen()

Setter of property shadesPen .

PySide6.QtCharts.QAbstractAxis.setShadesVisible([visible=true])#
Parameters:

visible – bool

See also

shadesVisible()

Setter of property shadesVisible .

PySide6.QtCharts.QAbstractAxis.setTitleBrush(brush)#
Parameters:

brushPySide6.QtGui.QBrush

Sets the brush used to draw titles to brush.

See also

titleBrush()

Setter of property titleBrush .

PySide6.QtCharts.QAbstractAxis.setTitleFont(font)#
Parameters:

fontPySide6.QtGui.QFont

Sets the font used to draw titles to font.

See also

titleFont()

Setter of property titleFont .

PySide6.QtCharts.QAbstractAxis.setTitleText(title)#
Parameters:

title – str

See also

titleText()

Setter of property titleText .

PySide6.QtCharts.QAbstractAxis.setTitleVisible([visible=true])#
Parameters:

visible – bool

See also

isTitleVisible()

Setter of property titleVisible .

PySide6.QtCharts.QAbstractAxis.setTruncateLabels([truncateLabels=true])#
Parameters:

truncateLabels – bool

See also

truncateLabels()

Setter of property truncateLabels .

PySide6.QtCharts.QAbstractAxis.setVisible([visible=true])#
Parameters:

visible – bool

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

See also

isVisible()

Setter of property visible .

PySide6.QtCharts.QAbstractAxis.shadesBorderColor()#
Return type:

PySide6.QtGui.QColor

Getter of property shadesBorderColor .

PySide6.QtCharts.QAbstractAxis.shadesBorderColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the border color of the axis shades changes to color.

Notification signal of property shadesBorderColor .

PySide6.QtCharts.QAbstractAxis.shadesBrush()#
Return type:

PySide6.QtGui.QBrush

Returns the brush used to draw shades.

See also

setShadesBrush()

Getter of property shadesBrush .

PySide6.QtCharts.QAbstractAxis.shadesBrushChanged(brush)#
Parameters:

brushPySide6.QtGui.QBrush

This signal is emitted when the brush used to draw the axis shades changes to brush.

Notification signal of property shadesBrush .

PySide6.QtCharts.QAbstractAxis.shadesColor()#
Return type:

PySide6.QtGui.QColor

See also

setShadesColor()

Getter of property shadesColor .

PySide6.QtCharts.QAbstractAxis.shadesColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the color of the axis shades changes to color.

Notification signal of property shadesColor .

PySide6.QtCharts.QAbstractAxis.shadesPen()#
Return type:

PySide6.QtGui.QPen

Returns the pen used to draw shades.

See also

setShadesPen()

Getter of property shadesPen .

PySide6.QtCharts.QAbstractAxis.shadesPenChanged(pen)#
Parameters:

penPySide6.QtGui.QPen

This signal is emitted when the pen used to draw the axis shades changes to pen.

Notification signal of property shadesPen .

PySide6.QtCharts.QAbstractAxis.shadesVisible()#
Return type:

bool

Getter of property shadesVisible .

PySide6.QtCharts.QAbstractAxis.shadesVisibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the axis shades changes to visible.

Notification signal of property shadesVisible .

PySide6.QtCharts.QAbstractAxis.show()#

Makes the axis, shades, labels, and grid lines visible.

PySide6.QtCharts.QAbstractAxis.titleBrush()#
Return type:

PySide6.QtGui.QBrush

Returns the brush used to draw titles.

See also

setTitleBrush()

Getter of property titleBrush .

PySide6.QtCharts.QAbstractAxis.titleBrushChanged(brush)#
Parameters:

brushPySide6.QtGui.QBrush

This signal is emitted when the brush used to draw the axis title changes to brush.

Notification signal of property titleBrush .

PySide6.QtCharts.QAbstractAxis.titleFont()#
Return type:

PySide6.QtGui.QFont

Returns the font used to draw titles.

See also

setTitleFont()

Getter of property titleFont .

PySide6.QtCharts.QAbstractAxis.titleFontChanged(font)#
Parameters:

fontPySide6.QtGui.QFont

This signal is emitted when the font of the axis title changes to font.

Notification signal of property titleFont .

PySide6.QtCharts.QAbstractAxis.titleText()#
Return type:

str

See also

setTitleText()

Getter of property titleText .

PySide6.QtCharts.QAbstractAxis.titleTextChanged(title)#
Parameters:

title – str

This signal is emitted when the text of the axis title changes to text.

Notification signal of property titleText .

PySide6.QtCharts.QAbstractAxis.titleVisibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the title text of the axis changes to visible.

Notification signal of property titleVisible .

PySide6.QtCharts.QAbstractAxis.truncateLabels()#
Return type:

bool

Getter of property truncateLabels .

PySide6.QtCharts.QAbstractAxis.truncateLabelsChanged(truncateLabels)#
Parameters:

truncateLabels – bool

This signal is emitted when the truncation of the labels changes to truncateLabels.

Notification signal of property truncateLabels .

abstract PySide6.QtCharts.QAbstractAxis.type()#
Return type:

AxisType

Returns the type of the axis.

PySide6.QtCharts.QAbstractAxis.visibleChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the axis changes to visible.

Notification signal of property visible .