PySide6.QtGraphs.QCustomSeries

class QCustomSeries

The QCustomSeries class allows presenting customized graph types.

Details

Use QCustomSeries to create customized graphs. Think of it as a scatter graph that lets you access custom data for each element.

QCustomSeries defines a delegate that is used to render every item added to the graph. Each item includes user-defined data stored in a QVariantMap. Index of the item in the graph is also automatically added to the data map. The series passes this map to each element created based on the delegate. The delegate determines how to use the data.

To map data to the render coordinates defined by the QGraphsView axes, use the mapX and mapY functions.

Note

Currently, individual elements in a custom series do not share information with one another. For this reason, you can’t implement a custom line series.

Inheritance diagram of PySide6.QtGraphs.QCustomSeries

Added in version 6.11.

Synopsis

Properties

Methods

Virtual 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

Note

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

property delegateᅟ: QQmlComponent

The delegate is used to insert elements to QML corresponding to provided custom data. Data is defined in the CustomSeries itself and given to the delegated elements through the “data” property.

Access functions:
__init__([parent=None])
Parameters:

parentQObject

append()

Appends an empty data item to the series.

append(data)
Parameters:

data – Dictionary with keys of type .QString and values of type QVariant.

Appends a data item defined by data to the series.

clear()

Clear all data items.

delegate()
Return type:

QQmlComponent

See also

setDelegate()

Getter of property delegateᅟ .

delegateChanged()

Notification signal of property delegateᅟ .

insert(index)
Parameters:

index – int

Appends an empty data item to the series at position index.

insert(index, data)
Parameters:
  • index – int

  • data – Dictionary with keys of type .QString and values of type QVariant.

Appends a data item defined by data to the series at position index.

mapX(x)
Parameters:

x – float

Return type:

float

Returns x axis-space coordinate converted into render-space.

mapY(y)
Parameters:

y – float

Return type:

float

Returns y axis-space coordinate converted into render-space.

remove(index)
Parameters:

index – int

Remove a data item at position index.

setDelegate(newDelegate)
Parameters:

newDelegateQQmlComponent

See also

delegate()

Setter of property delegateᅟ .

updateDelegate(item, index)
Parameters:

Called by the graph renderer to give access to the item representing the data, and the index corresponding to the data item.

Override to implement custom property values for QQuickItem instance(s).