class 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

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#

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.

Note

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

property 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 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 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 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 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:
__init__([parent=None])#
Parameters:

parentQObject

autoRange()#
Return type:

bool

See also

setAutoRange()

Getter of property autoRangeᅟ .

autoRangeChanged(autoRange)#
Parameters:

autoRange – bool

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

Notification signal of property autoRangeᅟ .

gradient()#
Return type:

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

gradientChanged(gradient)#
Parameters:

gradientQLinearGradient

max()#
Return type:

float

See also

setMax()

Getter of property maxᅟ .

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

min()#
Return type:

float

See also

setMin()

Getter of property minᅟ .

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

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.

setAutoRange(autoRange)#
Parameters:

autoRange – bool

See also

autoRange()

Setter of property autoRangeᅟ .

setGradient(gradient)#
Parameters:

gradientQLinearGradient

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

setMax(max)#
Parameters:

max – float

See also

max()

Setter of property maxᅟ .

setMin(min)#
Parameters:

min – float

See also

min()

Setter of property minᅟ .

setRange(min, max)#
Parameters:
  • min – float

  • max – float

setSize(size)#
Parameters:

size – float

See also

size()

Setter of property sizeᅟ .

setTickCount(count)#
Parameters:

count – int

See also

tickCount()

Setter of property tickCountᅟ .

size()#
Return type:

float

See also

setSize()

Getter of property sizeᅟ .

sizeChanged(size)#
Parameters:

size – float

Notification signal of property sizeᅟ .

tickCount()#
Return type:

int

See also

setTickCount()

Getter of property tickCountᅟ .

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