class 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

  • 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

Methods#

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

Note

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

property borderColorᅟ: 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 colorᅟ: 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 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 pointLabelsColorᅟ: 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 pointLabelsFontᅟ: QFont#

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

Access functions:
property 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 pointLabelsVisibleᅟ: bool#

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

Access functions:
__init__([parent=None])#
Parameters:

parentQObject

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

borderColor()#
Return type:

QColor

See also

setBorderColor()

Getter of property borderColorᅟ .

borderColorChanged(color)#
Parameters:

colorQColor

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

Notification signal of property borderColorᅟ .

brush()#
Return type:

QBrush

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

See also

setBrush()

clicked(point)#
Parameters:

pointQPointF

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

color()#
Return type:

QColor

See also

setColor()

Getter of property colorᅟ .

colorChanged(color)#
Parameters:

colorQColor

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

Notification signal of property colorᅟ .

doubleClicked(point)#
Parameters:

pointQPointF

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

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.

pen()#
Return type:

QPen

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

See also

setPen()

pointLabelsClipping()#
Return type:

bool

Getter of property pointLabelsClippingᅟ .

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

pointLabelsColor()#
Return type:

QColor

Getter of property pointLabelsColorᅟ .

pointLabelsColorChanged(color)#
Parameters:

colorQColor

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

Notification signal of property pointLabelsColorᅟ .

pointLabelsFont()#
Return type:

QFont

Getter of property pointLabelsFontᅟ .

pointLabelsFontChanged(font)#
Parameters:

fontQFont

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

Notification signal of property pointLabelsFontᅟ .

pointLabelsFormat()#
Return type:

str

Getter of property pointLabelsFormatᅟ .

pointLabelsFormatChanged(format)#
Parameters:

format – str

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

Notification signal of property pointLabelsFormatᅟ .

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

pointLabelsVisible()#
Return type:

bool

Getter of property pointLabelsVisibleᅟ .

pointsVisible()#
Return type:

bool

Returns whether the points are drawn for this series.

pressed(point)#
Parameters:

pointQPointF

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

released(point)#
Parameters:

pointQPointF

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

selected()#
setBorderColor(color)#
Parameters:

colorQColor

See also

borderColor()

Setter of property borderColorᅟ .

setBrush(brush)#
Parameters:

brushQBrush

Sets the brush used for filling the area.

See also

brush()

setColor(color)#
Parameters:

colorQColor

See also

color()

Setter of property colorᅟ .

setPen(pen)#
Parameters:

penQPen

Sets the pen used for drawing the area outline.

See also

pen()

setPointLabelsClipping([enabled=true])#
Parameters:

enabled – bool

Setter of property pointLabelsClippingᅟ .

setPointLabelsColor(color)#
Parameters:

colorQColor

Setter of property pointLabelsColorᅟ .

setPointLabelsFont(font)#
Parameters:

fontQFont

Setter of property pointLabelsFontᅟ .

setPointLabelsFormat(format)#
Parameters:

format – str

Setter of property pointLabelsFormatᅟ .

setPointLabelsVisible([visible=true])#
Parameters:

visible – bool

Setter of property pointLabelsVisibleᅟ .

setPointsVisible([visible=true])#
Parameters:

visible – bool

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

See also

pointsVisible()