QChartView#

The QChartView is a standalone widget that can display charts. More

Inheritance diagram of PySide6.QtCharts.QChartView

Synopsis#

Functions#

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 chart view does not require a QGraphicsScene object to work. To display a chart in an existing QGraphicsScene, the QChart or QPolarChart class should be used instead.

See also

QChart QPolarChart

class PySide6.QtCharts.QChartView(chart[, parent=None])#

PySide6.QtCharts.QChartView([parent=None])

Parameters:

Constructs a chart view object with the parent parent to display the chart chart. The ownership of the chart is passed to the chart view.

Constructs a chart view object with the parent parent.

PySide6.QtCharts.QChartView.RubberBand#

(inherits enum.Flag) This enum describes the different types of rubber band effects that can be applied to the rectangular zooming area.

Constant

Description

QChartView.NoRubberBand

No zooming area is specified, and therefore zooming is not enabled.

QChartView.VerticalRubberBand

The rubber band is locked to the size of the chart horizontally and can be pulled vertically to specify the zooming area.

QChartView.HorizontalRubberBand

The rubber band is locked to the size of the chart vertically and can be pulled horizontally to specify the zooming area.

QChartView.RectangleRubberBand

The rubber band is fixed to the point that was clicked and can be pulled both vertically and horizontally.

QChartView.ClickThroughRubberBand

An option on the above rubber band choices that allows left clicks to be passed on to chart items if those chart items accept clicks. To select this, OR it with one of the rubber band selection modes.

PySide6.QtCharts.QChartView.chart()#
Return type:

PySide6.QtCharts.QChart

Returns the pointer to the associated chart.

See also

setChart()

PySide6.QtCharts.QChartView.rubberBand()#
Return type:

Combination of QChartView.RubberBand

Returns the rubber band flags that are currently being used by the chart view.

See also

setRubberBand()

PySide6.QtCharts.QChartView.setChart(chart)#
Parameters:

chartPySide6.QtCharts.QChart

Sets the current chart to chart. The ownership of the new chart is passed to the chart view and the ownership of the previous chart is released.

To avoid memory leaks, the previous chart must be deleted.

See also

chart()

PySide6.QtCharts.QChartView.setRubberBand(rubberBands)#
Parameters:

rubberBands – Combination of QChartView.RubberBand

Sets the rubber band flags to rubberBand. The selected flags determine the way zooming is performed.

Note

Rubber band zooming is not supported for polar charts.

See also

rubberBand()