class QChartView#

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

Inheritance diagram of PySide6.QtCharts.QChartView

Synopsis#

Methods#

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 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.

__init__(chart[, 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.

__init__([parent=None])
Parameters:

parentQWidget

Constructs a chart view object with the parent parent.

chart()#
Return type:

QChart

Returns the pointer to the associated chart.

See also

setChart()

rubberBand()#
Return type:

Combination of RubberBand

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

See also

setRubberBand()

setChart(chart)#
Parameters:

chartQChart

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()

setRubberBand(rubberBands)#
Parameters:

rubberBands – Combination of 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()