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

Methods#

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

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

Note

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

property brushᅟ: QBrush#

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

Access functions:
property fontᅟ: QFont#

This property holds The font of the label..

Access functions:
property labelᅟ: str#

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

Access functions:
property labelBrushᅟ: QBrush#

This property holds The brush of the label..

Access functions:
property penᅟ: QPen#

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

Access functions:
property shapeᅟ: QLegend.MarkerShape#

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

Access functions:
property visibleᅟ: bool#

This property holds The visibility of the legend marker..

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

Access functions:
brush()#
Return type:

QBrush

Returns the brush used to fill the icon.

See also

setBrush()

Getter of property brushᅟ .

brushChanged()#

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

Notification signal of property brushᅟ .

clicked()#

This signal is emitted when the legend marker is clicked.

font()#
Return type:

QFont

Retuns the font of the label.

See also

setFont()

Getter of property fontᅟ .

fontChanged()#

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

Notification signal of property fontᅟ .

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.

isVisible()#
Return type:

bool

Returns the visibility of the marker.

Getter of property visibleᅟ .

label()#
Return type:

str

Returns the label of the marker.

See also

setLabel()

Getter of property labelᅟ .

labelBrush()#
Return type:

QBrush

Returns the brush that is used to draw the label.

See also

setLabelBrush()

Getter of property labelBrushᅟ .

labelBrushChanged()#

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

Notification signal of property labelBrushᅟ .

labelChanged()#

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

Notification signal of property labelᅟ .

pen()#
Return type:

QPen

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

See also

setPen()

Getter of property penᅟ .

penChanged()#

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

Notification signal of property penᅟ .

setBrush(brush)#
Parameters:

brushQBrush

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

setFont(font)#
Parameters:

fontQFont

Sets the font of the label to font.

See also

font()

Setter of property fontᅟ .

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

setLabelBrush(brush)#
Parameters:

brushQBrush

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

See also

labelBrush()

Setter of property labelBrushᅟ .

setPen(pen)#
Parameters:

penQPen

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

See also

pen()

Setter of property penᅟ .

setShape(shape)#
Parameters:

shapeMarkerShape

See also

shape()

Setter of property shapeᅟ .

setVisible(visible)#
Parameters:

visible – bool

Sets the marker’s visibility to visible.

See also

isVisible()

Setter of property visibleᅟ .

shape()#
Return type:

MarkerShape

See also

setShape()

Getter of property shapeᅟ .

shapeChanged()#

Notification signal of property shapeᅟ .

abstract type()#
Return type:

LegendMarkerType

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

See also

LegendMarkerType

visibleChanged()#

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

Notification signal of property visibleᅟ .