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

Functions

Virtual functions

Signals

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
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

This property holds The alignment of the axis..

Can be AlignLeft , AlignRight , AlignBottom , or AlignTop .

PySide6.QtCharts.QAbstractAxis.colorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QAbstractAxis.gridLineColor()
Return type

PySide6.QtGui.QColor

This property holds The color of the grid line..

PySide6.QtCharts.QAbstractAxis.gridLineColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QAbstractAxis.gridLinePen()
Return type

PySide6.QtGui.QPen

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

PySide6.QtCharts.QAbstractAxis.gridLinePenChanged(pen)
Parameters

penPySide6.QtGui.QPen

PySide6.QtCharts.QAbstractAxis.gridVisibleChanged(visible)
Parameters

visible – bool

PySide6.QtCharts.QAbstractAxis.hide()

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

PySide6.QtCharts.QAbstractAxis.isGridLineVisible()
Return type

bool

This property holds The visibility of the grid lines..

PySide6.QtCharts.QAbstractAxis.isLineVisible()
Return type

bool

This property holds The visibility of the axis line..

PySide6.QtCharts.QAbstractAxis.isMinorGridLineVisible()
Return type

bool

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

Applies only to axes that support minor grid lines.

PySide6.QtCharts.QAbstractAxis.isReverse()
Return type

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.

PySide6.QtCharts.QAbstractAxis.isTitleVisible()
Return type

bool

This property holds The visibility of the axis title..

By default, the value is true.

PySide6.QtCharts.QAbstractAxis.isVisible()
Return type

bool

This property holds The visibility of the axis..

PySide6.QtCharts.QAbstractAxis.labelsAngle()
Return type

int

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

PySide6.QtCharts.QAbstractAxis.labelsAngleChanged(angle)
Parameters

angle – int

PySide6.QtCharts.QAbstractAxis.labelsBrush()
Return type

PySide6.QtGui.QBrush

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

Only the color of the brush is relevant.

PySide6.QtCharts.QAbstractAxis.labelsBrushChanged(brush)
Parameters

brushPySide6.QtGui.QBrush

PySide6.QtCharts.QAbstractAxis.labelsColor()
Return type

PySide6.QtGui.QColor

This property holds The color of the axis labels..

PySide6.QtCharts.QAbstractAxis.labelsColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QAbstractAxis.labelsEditable()
Return type

bool

Returns true if axis labels are editable.

PySide6.QtCharts.QAbstractAxis.labelsEditableChanged(editable)
Parameters

editable – bool

PySide6.QtCharts.QAbstractAxis.labelsFont()
Return type

PySide6.QtGui.QFont

This property holds The font of the axis labels..

PySide6.QtCharts.QAbstractAxis.labelsFontChanged(pen)
Parameters

penPySide6.QtGui.QFont

PySide6.QtCharts.QAbstractAxis.labelsTruncated()
Return type

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.

PySide6.QtCharts.QAbstractAxis.labelsTruncatedChanged(labelsTruncated)
Parameters

labelsTruncated – bool

PySide6.QtCharts.QAbstractAxis.labelsVisible()
Return type

bool

This property holds Whether axis labels are visible..

PySide6.QtCharts.QAbstractAxis.labelsVisibleChanged(visible)
Parameters

visible – bool

PySide6.QtCharts.QAbstractAxis.linePen()
Return type

PySide6.QtGui.QPen

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

PySide6.QtCharts.QAbstractAxis.linePenChanged(pen)
Parameters

penPySide6.QtGui.QPen

PySide6.QtCharts.QAbstractAxis.linePenColor()
Return type

PySide6.QtGui.QColor

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

PySide6.QtCharts.QAbstractAxis.lineVisibleChanged(visible)
Parameters

visible – bool

PySide6.QtCharts.QAbstractAxis.minorGridLineColor()
Return type

PySide6.QtGui.QColor

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

Applies only to axes that support minor grid lines.

PySide6.QtCharts.QAbstractAxis.minorGridLineColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QAbstractAxis.minorGridLinePen()
Return type

PySide6.QtGui.QPen

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

Applies only to axes that support minor grid lines.

PySide6.QtCharts.QAbstractAxis.minorGridLinePenChanged(pen)
Parameters

penPySide6.QtGui.QPen

PySide6.QtCharts.QAbstractAxis.minorGridVisibleChanged(visible)
Parameters

visible – bool

PySide6.QtCharts.QAbstractAxis.orientation()
Return type

Orientation

This property holds The orientation of the axis..

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

PySide6.QtCharts.QAbstractAxis.reverseChanged(reverse)
Parameters

reverse – bool

PySide6.QtCharts.QAbstractAxis.setGridLineColor(color)
Parameters

colorPySide6.QtGui.QColor

This property holds The color of the grid line..

PySide6.QtCharts.QAbstractAxis.setGridLinePen(pen)
Parameters

penPySide6.QtGui.QPen

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

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

visible – bool

This property holds The visibility of the grid lines..

PySide6.QtCharts.QAbstractAxis.setLabelsAngle(angle)
Parameters

angle – int

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

PySide6.QtCharts.QAbstractAxis.setLabelsBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

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

Only the color of the brush is relevant.

PySide6.QtCharts.QAbstractAxis.setLabelsColor(color)
Parameters

colorPySide6.QtGui.QColor

This property holds The color of the axis labels..

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

This property holds The font of the axis labels..

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

visible – bool

This property holds Whether axis labels are visible..

PySide6.QtCharts.QAbstractAxis.setLinePen(pen)
Parameters

penPySide6.QtGui.QPen

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

PySide6.QtCharts.QAbstractAxis.setLinePenColor(color)
Parameters

colorPySide6.QtGui.QColor

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

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

visible – bool

This property holds The visibility of the axis line..

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

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

Applies only to axes that support minor grid lines.

PySide6.QtCharts.QAbstractAxis.setMinorGridLinePen(pen)
Parameters

penPySide6.QtGui.QPen

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

Applies only to axes that support minor grid lines.

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

visible – bool

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

Applies only to axes that support minor grid lines.

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

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.

PySide6.QtCharts.QAbstractAxis.setShadesBorderColor(color)
Parameters

colorPySide6.QtGui.QColor

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

PySide6.QtCharts.QAbstractAxis.setShadesBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

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

PySide6.QtCharts.QAbstractAxis.setShadesColor(color)
Parameters

colorPySide6.QtGui.QColor

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

PySide6.QtCharts.QAbstractAxis.setShadesPen(pen)
Parameters

penPySide6.QtGui.QPen

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

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

visible – bool

This property holds The visibility of the axis shades..

PySide6.QtCharts.QAbstractAxis.setTitleBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

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

Only the color of the brush is relevant.

PySide6.QtCharts.QAbstractAxis.setTitleFont(font)
Parameters

fontPySide6.QtGui.QFont

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

PySide6.QtCharts.QAbstractAxis.setTitleText(title)
Parameters

title – str

This property holds The title of the axis..

Empty by default. Axis titles support HTML formatting.

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

visible – bool

This property holds The visibility of the axis title..

By default, the value is true.

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

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.

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

visible – bool

This property holds The visibility of the axis..

PySide6.QtCharts.QAbstractAxis.shadesBorderColor()
Return type

PySide6.QtGui.QColor

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

PySide6.QtCharts.QAbstractAxis.shadesBorderColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QAbstractAxis.shadesBrush()
Return type

PySide6.QtGui.QBrush

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

PySide6.QtCharts.QAbstractAxis.shadesBrushChanged(brush)
Parameters

brushPySide6.QtGui.QBrush

PySide6.QtCharts.QAbstractAxis.shadesColor()
Return type

PySide6.QtGui.QColor

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

PySide6.QtCharts.QAbstractAxis.shadesColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QAbstractAxis.shadesPen()
Return type

PySide6.QtGui.QPen

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

PySide6.QtCharts.QAbstractAxis.shadesPenChanged(pen)
Parameters

penPySide6.QtGui.QPen

PySide6.QtCharts.QAbstractAxis.shadesVisible()
Return type

bool

This property holds The visibility of the axis shades..

PySide6.QtCharts.QAbstractAxis.shadesVisibleChanged(visible)
Parameters

visible – bool

PySide6.QtCharts.QAbstractAxis.show()

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

PySide6.QtCharts.QAbstractAxis.titleBrush()
Return type

PySide6.QtGui.QBrush

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

Only the color of the brush is relevant.

PySide6.QtCharts.QAbstractAxis.titleBrushChanged(brush)
Parameters

brushPySide6.QtGui.QBrush

PySide6.QtCharts.QAbstractAxis.titleFont()
Return type

PySide6.QtGui.QFont

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

PySide6.QtCharts.QAbstractAxis.titleFontChanged(font)
Parameters

fontPySide6.QtGui.QFont

PySide6.QtCharts.QAbstractAxis.titleText()
Return type

str

This property holds The title of the axis..

Empty by default. Axis titles support HTML formatting.

PySide6.QtCharts.QAbstractAxis.titleTextChanged(title)
Parameters

title – str

PySide6.QtCharts.QAbstractAxis.titleVisibleChanged(visible)
Parameters

visible – bool

PySide6.QtCharts.QAbstractAxis.truncateLabels()
Return type

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.

PySide6.QtCharts.QAbstractAxis.truncateLabelsChanged(truncateLabels)
Parameters

truncateLabels – bool

PySide6.QtCharts.QAbstractAxis.type()
Return type

AxisType

Returns the type of the axis.

PySide6.QtCharts.QAbstractAxis.visibleChanged(visible)
Parameters

visible – bool