QHXYModelMapper#

The QHXYModelMapper class is a horizontal model mapper for line, spline, and scatter series. More

Inheritance diagram of PySide6.QtCharts.QHXYModelMapper

Synopsis#

Properties#

  • columnCount - Number of columns of the model that are mapped as the data for series

  • firstColumn - Column of the model that contains the data for the first point of the series

  • model - That is used by the mapper

  • series - That is used by the mapper

  • xRow - Row of the model that contains the x-coordinates of the data points

  • yRow - Row of the model that contains the y-coordinates of the data points

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#

Model mappers enable using a data model derived from the QAbstractItemModel class as a data source for a chart. A horizontal model mapper is used to create a connection between a line, spline, or scatter series and the data model that has X and Y rows for the coordinates and holds the data points for the XYSeries as columns. A TableModel is a natural choice for the model.

Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync.

See also

QVXYModelMapper QXYSeries Charts with Widgets Gallery

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

parentPySide6.QtCore.QObject

Constructs a mapper object that is a child of parent.

Note

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

property PᅟySide6.QtCharts.QHXYModelMapper.columnCount: int#

This property holds The number of columns of the model that are mapped as the data for series..

The minimum and default value is -1 (the number is limited by the number of columns in the model).

Access functions:
property PᅟySide6.QtCharts.QHXYModelMapper.firstColumn: int#

This property holds The column of the model that contains the data for the first point of the series..

The minimum and default value is 0.

Access functions:
property PᅟySide6.QtCharts.QHXYModelMapper.model: PySide6.QtCore.QAbstractItemModel#

This property holds The model that is used by the mapper..

Access functions:
property PᅟySide6.QtCharts.QHXYModelMapper.series: PySide6.QtCharts.QXYSeries#

This property holds The series that is used by the mapper..

All the data in the series is discarded when it is set to the mapper. When a new series is specified, the old series is disconnected (but it preserves its data).

Access functions:
property PᅟySide6.QtCharts.QHXYModelMapper.xRow: int#

This property holds The row of the model that contains the x-coordinates of the data points..

The default value is -1 (invalid mapping).

Access functions:
property PᅟySide6.QtCharts.QHXYModelMapper.yRow: int#

This property holds The row of the model that contains the y-coordinates of the data points..

The default value is -1 (invalid mapping).

Access functions:
PySide6.QtCharts.QHXYModelMapper.columnCount()#
Return type:

int

See also

setColumnCount()

Getter of property columnCount .

PySide6.QtCharts.QHXYModelMapper.columnCountChanged()#

This signal is emitted when the number of columns changes.

Notification signal of property columnCount .

PySide6.QtCharts.QHXYModelMapper.firstColumn()#
Return type:

int

See also

setFirstColumn()

Getter of property firstColumn .

PySide6.QtCharts.QHXYModelMapper.firstColumnChanged()#

This signal is emitted when the first column changes.

Notification signal of property firstColumn .

PySide6.QtCharts.QHXYModelMapper.modelReplaced()#

This signal is emitted when the model that the mapper is connected to changes.

Notification signal of property model .

PySide6.QtCharts.QHXYModelMapper.seriesReplaced()#

This signal is emitted when the series that the mapper is connected to changes.

Notification signal of property series .

PySide6.QtCharts.QHXYModelMapper.setColumnCount(columnCount)#
Parameters:

columnCount – int

See also

columnCount()

Setter of property columnCount .

PySide6.QtCharts.QHXYModelMapper.setFirstColumn(firstColumn)#
Parameters:

firstColumn – int

See also

firstColumn()

Setter of property firstColumn .

PySide6.QtCharts.QHXYModelMapper.setXRow(xRow)#
Parameters:

xRow – int

See also

xRow()

Setter of property xRow .

PySide6.QtCharts.QHXYModelMapper.setYRow(yRow)#
Parameters:

yRow – int

See also

yRow()

Setter of property yRow .

PySide6.QtCharts.QHXYModelMapper.xRow()#
Return type:

int

See also

setXRow()

Getter of property xRow .

PySide6.QtCharts.QHXYModelMapper.xRowChanged()#

This signal is emitted when the row that contains the x-coordinates of data points changes.

Notification signal of property xRow .

PySide6.QtCharts.QHXYModelMapper.yRow()#
Return type:

int

See also

setYRow()

Getter of property yRow .

PySide6.QtCharts.QHXYModelMapper.yRowChanged()#

This signal is emitted when the row that contains the y-coordinates of data points changes.

Notification signal of property yRow .