QColorAxis#

The QColorAxis class displays a color scale as one of the chart’s axes. More

Inheritance diagram of PySide6.QtCharts.QColorAxis

Synopsis#

Properties#

  • autoRange - Property indicating if the range should be set from the list of values passed in QXYSeries::colorBy method or rather taken from the axis itself

  • max - Maximum value on the axis

  • min - Minimum value on the axis

  • size - Of the color scale

  • tickCount - Number of tick marks on the axis. This indicates how many grid lines are drawn on the chart if QColorAxis::gridVisible is equal to true. The default value is 5, and the number cannot be less than 2

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#

A color axis can be set up to show a color scale based on the passed gradient. The scale has tick marks with labels based on data passed in QXYSeries::colorby method.

class PySide6.QtCharts.QColorAxis([parent=None])#
Parameters:

parentPySide6.QtCore.QObject

Note

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

property PᅟySide6.QtCharts.QColorAxis.autoRange: bool#

This property holds The property indicating if the range should be set from the list of values passed in colorBy method or rather taken from the axis itself..

The default value is true.

Access functions:
property PᅟySide6.QtCharts.QColorAxis.max: float#

This property holds The maximum value on the axis..

When setting this property, the minimum value is adjusted if necessary, to ensure that the range remains valid.

Access functions:
property PᅟySide6.QtCharts.QColorAxis.min: float#

This property holds The minimum value on the axis..

When setting this property, the maximum value is adjusted if necessary, to ensure that the range remains valid.

Access functions:
property PᅟySide6.QtCharts.QColorAxis.size: float#

This property holds The size of the color scale..

Depending on the alignment the value indicates either width or height.

Access functions:
property PᅟySide6.QtCharts.QColorAxis.tickCount: int#

This property holds The number of tick marks on the axis. This indicates how many grid lines are drawn on the chart if QColorAxis::gridVisible is equal to true. The default value is 5, and the number cannot be less than 2..

Note

Grid lines are intentionally invisible by default in QColorAxis as this type of axis does not represent geometric values.

Access functions:
PySide6.QtCharts.QColorAxis.autoRange()#
Return type:

bool

See also

setAutoRange()

Getter of property autoRange .

PySide6.QtCharts.QColorAxis.autoRangeChanged(autoRange)#
Parameters:

autoRange – bool

This signal is emitted when the auto range mode, specified by autoRange, changes.

Notification signal of property autoRange .

PySide6.QtCharts.QColorAxis.gradient()#
Return type:

PySide6.QtGui.QLinearGradient

Returns the gradient currently used on the color scale.

Note

If the axis is attached to a series, the gradient is also used by the colorBy method.

See also

setGradient

PySide6.QtCharts.QColorAxis.gradientChanged(gradient)#
Parameters:

gradientPySide6.QtGui.QLinearGradient

PySide6.QtCharts.QColorAxis.max()#
Return type:

float

See also

setMax()

Getter of property max .

PySide6.QtCharts.QColorAxis.maxChanged(max)#
Parameters:

max – float

This signal is emitted when the maximum value of the axis, specified by max, changes.

Notification signal of property max .

PySide6.QtCharts.QColorAxis.min()#
Return type:

float

See also

setMin()

Getter of property min .

PySide6.QtCharts.QColorAxis.minChanged(min)#
Parameters:

min – float

This signal is emitted when the minimum value of the axis, specified by min, changes.

Notification signal of property min .

PySide6.QtCharts.QColorAxis.rangeChanged(min, max)#
Parameters:
  • min – float

  • max – float

This signal is emitted when the minimum or maximum value of the axis, specified by min and max, changes.

PySide6.QtCharts.QColorAxis.setAutoRange(autoRange)#
Parameters:

autoRange – bool

See also

autoRange()

Setter of property autoRange .

PySide6.QtCharts.QColorAxis.setGradient(gradient)#
Parameters:

gradientPySide6.QtGui.QLinearGradient

Sets the gradient on the color scale to gradient.

Note

If the axis is attached to a series, the gradient is also used by the colorBy method.

See also

gradient

PySide6.QtCharts.QColorAxis.setMax(max)#
Parameters:

max – float

See also

max()

Setter of property max .

PySide6.QtCharts.QColorAxis.setMin(min)#
Parameters:

min – float

See also

min()

Setter of property min .

PySide6.QtCharts.QColorAxis.setRange(min, max)#
Parameters:
  • min – float

  • max – float

PySide6.QtCharts.QColorAxis.setSize(size)#
Parameters:

size – float

See also

size()

Setter of property size .

PySide6.QtCharts.QColorAxis.setTickCount(count)#
Parameters:

count – int

See also

tickCount()

Setter of property tickCount .

PySide6.QtCharts.QColorAxis.size()#
Return type:

float

See also

setSize()

Getter of property size .

PySide6.QtCharts.QColorAxis.sizeChanged(size)#
Parameters:

size – float

Notification signal of property size .

PySide6.QtCharts.QColorAxis.tickCount()#
Return type:

int

See also

setTickCount()

Getter of property tickCount .

PySide6.QtCharts.QColorAxis.tickCountChanged(tickCount)#
Parameters:

tickCount – int

This signal is emitted when the number of tick marks on the axis, specified by tickCount, changes.

Notification signal of property tickCount .