PySide6.QtGraphs.QCustomSeries¶
- class QCustomSeries¶
The
QCustomSeriesclass allows presenting customized graph types.Details
Use
QCustomSeriesto create customized graphs. Think of it as a scatter graph that lets you access custom data for each element.QCustomSeriesdefines 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
QGraphsViewaxes, use themapXandmapYfunctions.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.
Added in version 6.11.
Synopsis¶
Properties¶
Methods¶
def
__init__()def
append()def
clear()def
delegate()def
insert()def
mapX()def
mapY()def
remove()def
setDelegate()
Virtual methods¶
def
updateDelegate()
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_propertyis 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:
- 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
datato the series.- clear()¶
Clear all data items.
- delegate()¶
- Return type:
See also
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
datato the series at positionindex.- mapX(x)¶
- Parameters:
x – float
- Return type:
float
Returns
xaxis-space coordinate converted into render-space.- mapY(y)¶
- Parameters:
y – float
- Return type:
float
Returns
yaxis-space coordinate converted into render-space.- remove(index)¶
- Parameters:
index – int
Remove a data item at position
index.- setDelegate(newDelegate)¶
- Parameters:
newDelegate –
QQmlComponent
See also
Setter of property
delegateᅟ.- updateDelegate(item, index)¶
- Parameters:
item –
QQuickItemindex – int
Called by the graph renderer to give access to the
itemrepresenting the data, and theindexcorresponding to the data item.Override to implement custom property values for QQuickItem instance(s).