QLegendMarker#

The QLegendMarker class is an abstract object that can be used to access markers within a legend. More

Inheritance diagram of PySide6.QtCharts.QLegendMarker

Inherited by: QXYLegendMarker, QPieLegendMarker, QCandlestickLegendMarker, QBoxPlotLegendMarker, QBarLegendMarker, QAreaLegendMarker

Synopsis#

Properties#

  • brush - Used to fill the icon

  • font - Of the label

  • label - Text shown in the legend for a legend marker

  • labelBrush - Brush of the label

  • pen - Used to draw the outline of the icon

  • shape

  • visible - Visibility of the legend marker

Functions#

Virtual 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#

A legend marker consists of an icon and a label. The icon color corresponds to the color used to draw a series and the label displays the name of the series (or the label of the slice for a pie series or bar set for a bar series). A legend marker is always related to one series, slice, or bar set.

../../_images/examples_percentbarchart_legend.png

See also

QLegend

class PySide6.QtCharts.QLegendMarker#

Note

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

property PᅟySide6.QtCharts.QLegendMarker.brush: PySide6.QtGui.QBrush#

This property holds The brush used to fill the icon..

Access functions:
property PᅟySide6.QtCharts.QLegendMarker.font: PySide6.QtGui.QFont#

This property holds The font of the label..

Access functions:
property PᅟySide6.QtCharts.QLegendMarker.label: str#

This property holds The text shown in the legend for a legend marker..

Access functions:
property PᅟySide6.QtCharts.QLegendMarker.labelBrush: PySide6.QtGui.QBrush#

This property holds The brush of the label..

Access functions:
property PᅟySide6.QtCharts.QLegendMarker.pen: PySide6.QtGui.QPen#

This property holds The pen used to draw the outline of the icon..

Access functions:
property PᅟySide6.QtCharts.QLegendMarker.shape: MarkerShape#

The shape of the legend marker. Defaults to MarkerShapeDefault , which indicates the shape is determined by markerShape property.

Access functions:
property PᅟySide6.QtCharts.QLegendMarker.visible: bool#

This property holds The visibility of the legend marker..

The visibility affects both the legend marker label and the icon.

Access functions:
PySide6.QtCharts.QLegendMarker.LegendMarkerType#

The type of the legend marker object.

Constant

Description

QLegendMarker.LegendMarkerTypeArea

A legend marker for an area series.

QLegendMarker.LegendMarkerTypeBar

A legend marker for a bar set.

QLegendMarker.LegendMarkerTypePie

A legend marker for a pie slice.

QLegendMarker.LegendMarkerTypeXY

A legend marker for a line, spline, or scatter series.

QLegendMarker.LegendMarkerTypeBoxPlot

A legend marker for a box plot series.

QLegendMarker.LegendMarkerTypeCandlestick

A legend marker for a candlestick series.

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

PySide6.QtGui.QBrush

Returns the brush used to fill the icon.

See also

setBrush()

Getter of property brush .

PySide6.QtCharts.QLegendMarker.brushChanged()#

This signal is emitted when the brush of the legend marker has changed.

Notification signal of property brush .

PySide6.QtCharts.QLegendMarker.clicked()#

This signal is emitted when the legend marker is clicked.

PySide6.QtCharts.QLegendMarker.font()#
Return type:

PySide6.QtGui.QFont

Retuns the font of the label.

See also

setFont()

Getter of property font .

PySide6.QtCharts.QLegendMarker.fontChanged()#

This signal is emitted when the (label) font of the legend marker has changed.

Notification signal of property font .

PySide6.QtCharts.QLegendMarker.hovered(status)#
Parameters:

status – bool

This signal is emitted when a mouse is hovered over the legend marker. When the mouse moves over the marker, status turns true, and when the mouse moves away again, it turns false.

PySide6.QtCharts.QLegendMarker.isVisible()#
Return type:

bool

Returns the visibility of the marker.

Getter of property visible .

PySide6.QtCharts.QLegendMarker.label()#
Return type:

str

Returns the label of the marker.

See also

setLabel()

Getter of property label .

PySide6.QtCharts.QLegendMarker.labelBrush()#
Return type:

PySide6.QtGui.QBrush

Returns the brush that is used to draw the label.

See also

setLabelBrush()

Getter of property labelBrush .

PySide6.QtCharts.QLegendMarker.labelBrushChanged()#

This signal is emitted when the label brush of the legend marker has changed.

Notification signal of property labelBrush .

PySide6.QtCharts.QLegendMarker.labelChanged()#

This signal is emitted when the label of the legend marker has changed.

Notification signal of property label .

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

PySide6.QtGui.QPen

Returns the pen used to draw the outline of the icon.

See also

setPen()

Getter of property pen .

PySide6.QtCharts.QLegendMarker.penChanged()#

This signal is emitted when the pen of the legend marker has changed.

Notification signal of property pen .

abstract PySide6.QtCharts.QLegendMarker.series()#
Return type:

PySide6.QtCharts.QAbstractSeries

Returns a pointer to the series that is related to this legend marker. A legend marker is always related to a series.

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

brushPySide6.QtGui.QBrush

Sets the brush used to fill the icon to brush.

Note

Changing the color of the series also changes the color of the icon.

See also

brush()

Setter of property brush .

PySide6.QtCharts.QLegendMarker.setFont(font)#
Parameters:

fontPySide6.QtGui.QFont

Sets the font of the label to font.

See also

font()

Setter of property font .

PySide6.QtCharts.QLegendMarker.setLabel(label)#
Parameters:

label – str

Sets the label of the marker to label.

Note

Changing the name of a series also changes the label of its marker.

See also

label()

Setter of property label .

PySide6.QtCharts.QLegendMarker.setLabelBrush(brush)#
Parameters:

brushPySide6.QtGui.QBrush

Sets the the brush used to draw to label to brush.

See also

labelBrush()

Setter of property labelBrush .

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

penPySide6.QtGui.QPen

Sets the pen used to draw the outline of the icon to pen.

See also

pen()

Setter of property pen .

PySide6.QtCharts.QLegendMarker.setShape(shape)#
Parameters:

shapeMarkerShape

See also

shape()

Setter of property shape .

PySide6.QtCharts.QLegendMarker.setVisible(visible)#
Parameters:

visible – bool

Sets the marker’s visibility to visible.

See also

isVisible()

Setter of property visible .

PySide6.QtCharts.QLegendMarker.shape()#
Return type:

MarkerShape

See also

setShape()

Getter of property shape .

PySide6.QtCharts.QLegendMarker.shapeChanged()#

Notification signal of property shape .

abstract PySide6.QtCharts.QLegendMarker.type()#
Return type:

LegendMarkerType

Returns the type of the legend marker for the related series, pie slice, or bar set.

See also

LegendMarkerType

PySide6.QtCharts.QLegendMarker.visibleChanged()#

This signal is emitted when the visibility of the legend marker has changed.

Notification signal of property visible .