QAreaSeries#

The QAreaSeries class presents data in area charts. More

Inheritance diagram of PySide6.QtCharts.QAreaSeries

Synopsis#

Properties#

  • borderColor - Line (pen) color of the series. This is a convenience property for modifying the color of the pen

  • color - Fill (brush) color of the series. This is a convenience property for modifying the color of the brush

  • lowerSeries - Lower one of the two line series used to define area series boundaries

  • pointLabelsClipping - Clipping for data point labels. True by default. The labels on the edge of the plot area are cut when clipping is enabled

  • pointLabelsColor - Color used for data point labels. By default, the color is the color of the brush defined for labels in the theme

  • pointLabelsFont - Font used for data point labels

  • pointLabelsFormat - Format used for showing labels with series points

  • pointLabelsVisible - Visibility of data point labels. False by default

  • upperSeries - Upper one of the two line series used to define area series boundaries

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#

An area series is used to show quantitative data. It is based on a line series, in the way that the area between the boundary lines is emphasized with color. Since the area series is based on the line series, the QAreaSeries constructor needs a QLineSeries instance, which defines the upper boundary of the area. The area chart is drawn using the bottom of the plot area as the lower boundary by default. Instead of the bottom of the plot area, the lower boundary can be specified by another line. In that case, QAreaSeries should be initialized with two QLineSeries instances.

Note

The terms upper and lower boundary can be misleading in cases where the value of the lower boundary is greater than that of the upper boundary. The main point is that the area between these two boundary lines will be filled.

See the Charts with Widgets Gallery to learn how to create a simple area chart.

../../_images/examples_areachart.png
class PySide6.QtCharts.QAreaSeries(upperSeries[, lowerSeries=None])#

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

Parameters:

Constructs an area series object that will be spanned between an upperSeries line and a lowerSeries line. If no lowerSeries is passed to the constructor, the x-axis is used as the lower bound instead.

The QAreaSeries does not own the upper or lower series, but the ownership stays with the caller. When the series object is added to QChartView or QChart , the instance ownership is transferred.

Constructs an area series object without an upper or a lower series with the parent object.

Note

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

property PᅟySide6.QtCharts.QAreaSeries.borderColor: PySide6.QtGui.QColor#

This property holds The line (pen) color of the series. This is a convenience property for modifying the color of the pen..

See also

pen()

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.color: PySide6.QtGui.QColor#

This property holds The fill (brush) color of the series. This is a convenience property for modifying the color of the brush..

See also

brush()

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.lowerSeries: PySide6.QtCharts.QLineSeries#

This property holds The lower one of the two line series used to define area series boundaries..

Note

If QAreaSeries was constructed without a lowerSeries, this is null.

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.pointLabelsClipping: bool#

This property holds The clipping for data point labels. True by default. The labels on the edge of the plot area are cut when clipping is enabled..

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.pointLabelsColor: PySide6.QtGui.QColor#

This property holds The color used for data point labels. By default, the color is the color of the brush defined for labels in the theme..

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.pointLabelsFont: PySide6.QtGui.QFont#

This property holds The font used for data point labels..

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.pointLabelsFormat: str#

This property holds The format used for showing labels with series points..

QAreaSeries supports the following format tags:

@xPoint

The x value of the data point

@yPoint

The y value of the data point

For example, the following usage of the format tags would produce labels that have the data point (x, y) shown inside brackets separated by a comma:

series->setPointLabelsFormat("(@xPoint, @yPoint)");

By default, the label format is set to @xPoint, @yPoint. The labels are shown on the plot area, whereas labels on the edge of the plot area are cut. If the points are close to each other, the labels may overlap.

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.pointLabelsVisible: bool#

This property holds The visibility of data point labels. False by default..

Access functions:
property PᅟySide6.QtCharts.QAreaSeries.upperSeries: PySide6.QtCharts.QLineSeries#

This property holds The upper one of the two line series used to define area series boundaries..

Access functions:
PySide6.QtCharts.QAreaSeries.borderColor()#
Return type:

PySide6.QtGui.QColor

See also

setBorderColor()

Getter of property borderColor .

PySide6.QtCharts.QAreaSeries.borderColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the line (pen) color changes to color.

Notification signal of property borderColor .

PySide6.QtCharts.QAreaSeries.brush()#
Return type:

PySide6.QtGui.QBrush

Returns the brush used to draw the line for this series.

See also

setBrush()

PySide6.QtCharts.QAreaSeries.clicked(point)#
Parameters:

pointPySide6.QtCore.QPointF

This signal is emitted when the user triggers a press on point by clicking it in an area chart.

PySide6.QtCharts.QAreaSeries.color()#
Return type:

PySide6.QtGui.QColor

See also

setColor()

Getter of property color .

PySide6.QtCharts.QAreaSeries.colorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the fill (brush) color changes to color.

Notification signal of property color .

PySide6.QtCharts.QAreaSeries.doubleClicked(point)#
Parameters:

pointPySide6.QtCore.QPointF

This signal is emitted when the user triggers the first press in an area chart by doubleclicking point.

PySide6.QtCharts.QAreaSeries.hovered(point, state)#
Parameters:

This signal is emitted when the user hovers the mouse cursor over a series or moves it away from the series. point shows the origin (coordinate) of the hover event. state is true when the cursor hovers over the series and turns false when it moves away from the series.

PySide6.QtCharts.QAreaSeries.lowerSeries()#
Return type:

PySide6.QtCharts.QLineSeries

See also

setLowerSeries()

Getter of property lowerSeries .

PySide6.QtCharts.QAreaSeries.pen()#
Return type:

PySide6.QtGui.QPen

Returns the pen used to draw the line for this series.

See also

setPen()

PySide6.QtCharts.QAreaSeries.pointLabelsClipping()#
Return type:

bool

Getter of property pointLabelsClipping .

PySide6.QtCharts.QAreaSeries.pointLabelsClippingChanged(clipping)#
Parameters:

clipping – bool

This signal is emitted when the clipping of the data point labels changes to clipping.

Notification signal of property pointLabelsClipping .

PySide6.QtCharts.QAreaSeries.pointLabelsColor()#
Return type:

PySide6.QtGui.QColor

Getter of property pointLabelsColor .

PySide6.QtCharts.QAreaSeries.pointLabelsColorChanged(color)#
Parameters:

colorPySide6.QtGui.QColor

This signal is emitted when the color used for data point labels changes to color.

Notification signal of property pointLabelsColor .

PySide6.QtCharts.QAreaSeries.pointLabelsFont()#
Return type:

PySide6.QtGui.QFont

Getter of property pointLabelsFont .

PySide6.QtCharts.QAreaSeries.pointLabelsFontChanged(font)#
Parameters:

fontPySide6.QtGui.QFont

This signal is emitted when the font used for data point labels changes to font.

Notification signal of property pointLabelsFont .

PySide6.QtCharts.QAreaSeries.pointLabelsFormat()#
Return type:

str

Getter of property pointLabelsFormat .

PySide6.QtCharts.QAreaSeries.pointLabelsFormatChanged(format)#
Parameters:

format – str

This signal is emitted when the format of data point labels is changed.

Notification signal of property pointLabelsFormat .

PySide6.QtCharts.QAreaSeries.pointLabelsVisibilityChanged(visible)#
Parameters:

visible – bool

This signal is emitted when the visibility of the data point labels changes to visible.

Notification signal of property pointLabelsVisible .

PySide6.QtCharts.QAreaSeries.pointLabelsVisible()#
Return type:

bool

Getter of property pointLabelsVisible .

PySide6.QtCharts.QAreaSeries.pointsVisible()#
Return type:

bool

Returns whether the points are drawn for this series.

PySide6.QtCharts.QAreaSeries.pressed(point)#
Parameters:

pointPySide6.QtCore.QPointF

This signal is emitted when the user presses the point specified by point in an area chart.

PySide6.QtCharts.QAreaSeries.released(point)#
Parameters:

pointPySide6.QtCore.QPointF

This signal is emitted when the user releases a press that was triggered on point in an area chart.

PySide6.QtCharts.QAreaSeries.selected()#
PySide6.QtCharts.QAreaSeries.setBorderColor(color)#
Parameters:

colorPySide6.QtGui.QColor

See also

borderColor()

Setter of property borderColor .

PySide6.QtCharts.QAreaSeries.setBrush(brush)#
Parameters:

brushPySide6.QtGui.QBrush

Sets the brush used for filling the area.

See also

brush()

PySide6.QtCharts.QAreaSeries.setColor(color)#
Parameters:

colorPySide6.QtGui.QColor

See also

color()

Setter of property color .

PySide6.QtCharts.QAreaSeries.setLowerSeries(series)#
Parameters:

seriesPySide6.QtCharts.QLineSeries

Sets the series that is to be used as the area chart lower series.

See also

lowerSeries()

PySide6.QtCharts.QAreaSeries.setPen(pen)#
Parameters:

penPySide6.QtGui.QPen

Sets the pen used for drawing the area outline.

See also

pen()

PySide6.QtCharts.QAreaSeries.setPointLabelsClipping([enabled=true])#
Parameters:

enabled – bool

Setter of property pointLabelsClipping .

PySide6.QtCharts.QAreaSeries.setPointLabelsColor(color)#
Parameters:

colorPySide6.QtGui.QColor

Setter of property pointLabelsColor .

PySide6.QtCharts.QAreaSeries.setPointLabelsFont(font)#
Parameters:

fontPySide6.QtGui.QFont

Setter of property pointLabelsFont .

PySide6.QtCharts.QAreaSeries.setPointLabelsFormat(format)#
Parameters:

format – str

Setter of property pointLabelsFormat .

PySide6.QtCharts.QAreaSeries.setPointLabelsVisible([visible=true])#
Parameters:

visible – bool

Setter of property pointLabelsVisible .

PySide6.QtCharts.QAreaSeries.setPointsVisible([visible=true])#
Parameters:

visible – bool

Determines whether data points are visible and should be drawn on the line.

See also

pointsVisible()

PySide6.QtCharts.QAreaSeries.setUpperSeries(series)#
Parameters:

seriesPySide6.QtCharts.QLineSeries

Sets the series that is to be used as the area chart upper series. If the upper series is null, the area chart is not drawn, even if it has a lower series.

See also

upperSeries()

PySide6.QtCharts.QAreaSeries.upperSeries()#
Return type:

PySide6.QtCharts.QLineSeries

See also

setUpperSeries()

Getter of property upperSeries .