class QAbstractSeries#

The QAbstractSeries class is a base class for all Qt Chart series. More

Inheritance diagram of PySide6.QtGraphs.QAbstractSeries

Inherited by: QXYSeries, QScatterSeries, QLineSeries, QAbstractBarSeries, QBarSeries, QStackedBarSeries, QSplineSeries, QPieSeries, QPercentBarSeries, QHorizontalStackedBarSeries, QHorizontalPercentBarSeries, QHorizontalBarSeries, QCandlestickSeries, QBoxPlotSeries, QAreaSeries

Synopsis#

Properties#

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#

Usually, the series type specific inherited classes are used instead of the base class.

class SeriesType#

This enum describes the type of the series.

Constant

Description

QAbstractSeries.SeriesTypeLine

A line chart.

QAbstractSeries.SeriesTypeArea

An area chart.

QAbstractSeries.SeriesTypeBar

A vertical bar chart.

QAbstractSeries.SeriesTypeStackedBar

A vertical stacked bar chart.

QAbstractSeries.SeriesTypePercentBar

A vertical percent bar chart.

QAbstractSeries.SeriesTypePie

A pie chart.

QAbstractSeries.SeriesTypeScatter

A scatter chart.

QAbstractSeries.SeriesTypeSpline

A spline chart.

QAbstractSeries.SeriesTypeHorizontalBar

A horizontal bar chart.

QAbstractSeries.SeriesTypeHorizontalStackedBar

A horizontal stacked bar chart.

QAbstractSeries.SeriesTypeHorizontalPercentBar

A horizontal percent bar chart.

QAbstractSeries.SeriesTypeBoxPlot

A box plot chart.

QAbstractSeries.SeriesTypeCandlestick

A candlestick chart.

Note

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

property nameᅟ: str#

This property holds The name of the series..

The name is displayed in the legend for the series and it supports HTML formatting.

Access functions:
property opacityᅟ: float#

This property holds The opacity of the series..

By default, the opacity is 1.0. The valid values range from 0.0 (transparent) to 1.0 (opaque).

Access functions:
property typeᅟ: QAbstractSeries.SeriesType#

This property holds The type of the series..

Access functions:

property useOpenGLᅟ: bool#

This property Specifies whether or not drawing the series is accelerated by using OpenGL..

Acceleration using OpenGL is supported only for QLineSeries and QScatterSeries . A line series used as an edge series for QAreaSeries cannot use OpenGL acceleration. When a chart contains any series that are drawn with OpenGL, a transparent QOpenGLWidget is created on top of the chart plot area. The accelerated series are not drawn on the underlying QGraphicsView, but are instead drawn on the created QOpenGLWidget.

Performance gained from using OpenGL to accelerate series drawing depends on the underlying hardware, but in most cases it is significant. For example, on a standard desktop computer, enabling OpenGL acceleration for a series typically allows rendering at least a hundred times more points without reduction on the frame rate. Chart size also has less effect on the frame rate.

The OpenGL acceleration of series drawing is meant for use cases that need fast drawing of large numbers of points. It is optimized for efficiency, and therefore the series using it lack support for many features available to non-accelerated series:

  • Series animations are not supported for accelerated series.

  • Point labels are not supported for accelerated series.

  • Pen styles, marker shapes and light markers are ignored for accelerated series. Only solid lines and plain scatter dots are supported. The scatter dots may be circular or rectangular, depending on the underlying graphics hardware and drivers.

  • Polar charts do not support accelerated series.

  • Enabling chart drop shadow or using transparent chart background color is not recommended when using accelerated series, as that can slow the frame rate down significantly.

These additional restrictions stem from the fact that the accelerated series is drawn on a separate widget on top of the chart:

  • If you draw any graphics items on top of a chart containing an accelerated series, the accelerated series is drawn over those items.

  • To enable QOpenGLWidget to be partially transparent, it needs to be stacked on top of all other widgets. This means you cannot have other widgets partially covering the chart when using accelerated series.

  • Accelerated series are not supported for use cases where the graphics scene has more than one graphics view attached to it.

  • Accelerated series are not supported for use cases where the chart has non-default geometry. For example, adding transforms to the graphics view causes the accelerated series to be drawn in an incorrect position related to the chart.

The default value is false.

Access functions:
property visibleᅟ: bool#

This property holds whether the series is visible or not..

By default, true.

Access functions:
chart()#
Return type:

QChart

Returns the chart that the series belongs to.

Set automatically when the series is added to the chart, and unset when the series is removed from the chart.

hide()#

Sets the visibility of the series to false.

isVisible()#
Return type:

bool

Getter of property visibleᅟ .

name()#
Return type:

str

See also

setName()

Getter of property nameᅟ .

nameChanged()#

This signal is emitted when the series name changes.

Notification signal of property nameᅟ .

opacity()#
Return type:

float

See also

setOpacity()

Getter of property opacityᅟ .

opacityChanged()#

This signal is emitted when the opacity of the series changes.

Notification signal of property opacityᅟ .

setName(name)#
Parameters:

name – str

See also

name()

Setter of property nameᅟ .

setOpacity(opacity)#
Parameters:

opacity – float

See also

opacity()

Setter of property opacityᅟ .

setUseOpenGL([enable=true])#
Parameters:

enable – bool

See also

useOpenGL()

Setter of property useOpenGLᅟ .

setVisible([visible=true])#
Parameters:

visible – bool

See also

isVisible()

Setter of property visibleᅟ .

show()#

Sets the visibility of the series to true.

useOpenGL()#
Return type:

bool

See also

setUseOpenGL()

Getter of property useOpenGLᅟ .

useOpenGLChanged()#

This signal is emitted when accelerating the drawing of the series by using OpenGL is enabled or disabled.

Notification signal of property useOpenGLᅟ .

visibleChanged()#

This signal is emitted when the series visibility changes.

Notification signal of property visibleᅟ .