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

Functions

Virtual functions

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

PySide6.QtCharts.QLegendMarker.brushChanged()
PySide6.QtCharts.QLegendMarker.clicked()
PySide6.QtCharts.QLegendMarker.font()
Return type

PySide6.QtGui.QFont

Retuns the font of the label.

See also

setFont()

PySide6.QtCharts.QLegendMarker.fontChanged()
PySide6.QtCharts.QLegendMarker.hovered(status)
Parameters

status – bool

PySide6.QtCharts.QLegendMarker.isVisible()
Return type

bool

Returns the visibility of the marker.

PySide6.QtCharts.QLegendMarker.label()
Return type

str

Returns the label of the marker.

See also

setLabel()

PySide6.QtCharts.QLegendMarker.labelBrush()
Return type

PySide6.QtGui.QBrush

Returns the brush that is used to draw the label.

See also

setLabelBrush()

PySide6.QtCharts.QLegendMarker.labelBrushChanged()
PySide6.QtCharts.QLegendMarker.labelChanged()
PySide6.QtCharts.QLegendMarker.pen()
Return type

PySide6.QtGui.QPen

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

See also

setPen()

PySide6.QtCharts.QLegendMarker.penChanged()
PySide6.QtCharts.QLegendMarker.series()
Return type

PySide6.QtCharts.QAbstractSeries

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

PySide6.QtCharts.QLegendMarker.setFont(font)
Parameters

fontPySide6.QtGui.QFont

Sets the font of the label to font.

See also

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

PySide6.QtCharts.QLegendMarker.setLabelBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

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

See also

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

PySide6.QtCharts.QLegendMarker.setShape(shape)
Parameters

shapeMarkerShape

See also

shape()

PySide6.QtCharts.QLegendMarker.setVisible(visible)
Parameters

visible – bool

Sets the marker’s visibility to visible.

See also

isVisible()

PySide6.QtCharts.QLegendMarker.shape()
Return type

MarkerShape

See also

setShape()

PySide6.QtCharts.QLegendMarker.shapeChanged()
PySide6.QtCharts.QLegendMarker.type()
Return type

LegendMarkerType

PySide6.QtCharts.QLegendMarker.visibleChanged()