QBarSet

The QBarSet class represents one set of bars in a bar chart. More

Inheritance diagram of PySide6.QtCharts.QBarSet

Synopsis

Functions

Signals

Detailed Description

A bar set contains one data value for each category. The first value of a set is assumed to belong to the first category, the second one to the second category, and so on. If the set has fewer values than there are categories, the missing values are assumed to be located at the end of the set. For missing values in the middle of a set, the numerical value of zero is used. Labels for zero value sets are not shown.

class PySide6.QtCharts.QBarSet(label[, parent=None])
Parameters

Constructs a bar set with the label label and the parent parent.

PySide6.QtCharts.QBarSet.append(values)
Parameters

values

PySide6.QtCharts.QBarSet.append(value)
Parameters

value – float

Appends the new value specified by value to the end of the bar set.

PySide6.QtCharts.QBarSet.at(index)
Parameters

index – int

Return type

float

Returns the value specified by index from the bar set. If the index is out of bounds, 0.0 is returned.

PySide6.QtCharts.QBarSet.borderColor()
Return type

PySide6.QtGui.QColor

This property holds The line (pen) color of the bar set..

PySide6.QtCharts.QBarSet.borderColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QBarSet.brush()
Return type

PySide6.QtGui.QBrush

This property holds The brush used to fill the bars in the bar set..

PySide6.QtCharts.QBarSet.brushChanged()
PySide6.QtCharts.QBarSet.clicked(index)
Parameters

index – int

PySide6.QtCharts.QBarSet.color()
Return type

PySide6.QtGui.QColor

This property holds The fill (brush) color of the bar set..

PySide6.QtCharts.QBarSet.colorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QBarSet.count()
Return type

int

Returns the number of values in a bar set.

PySide6.QtCharts.QBarSet.deselectAllBars()

Deselects all bars in the series.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.deselectBar(index)
Parameters

index – int

Deselects the bar at index.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.deselectBars(indexes)
Parameters

indexes

Marks multiple bars passed in an indexes list as deselected.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.doubleClicked(index)
Parameters

index – int

PySide6.QtCharts.QBarSet.hovered(status, index)
Parameters
  • status – bool

  • index – int

PySide6.QtCharts.QBarSet.insert(index, value)
Parameters
  • index – int

  • value – float

Inserts value in the position specified by index. The values following the inserted value are moved up one position.

See also

remove()

PySide6.QtCharts.QBarSet.isBarSelected(index)
Parameters

index – int

Return type

bool

Returns true if the bar at the given index is among selected bars and false otherwise.

Note

Selected bars are drawn using the selected color if it was specified using setSelectedColor .

PySide6.QtCharts.QBarSet.label()
Return type

str

This property holds The label of the bar set..

PySide6.QtCharts.QBarSet.labelBrush()
Return type

PySide6.QtGui.QBrush

This property holds The brush used to draw the bar set’s label..

PySide6.QtCharts.QBarSet.labelBrushChanged()
PySide6.QtCharts.QBarSet.labelChanged()
PySide6.QtCharts.QBarSet.labelColor()
Return type

PySide6.QtGui.QColor

This property holds The text (label) color of the bar set..

PySide6.QtCharts.QBarSet.labelColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QBarSet.labelFont()
Return type

PySide6.QtGui.QFont

This property holds The font used to draw the bar set’s label..

PySide6.QtCharts.QBarSet.labelFontChanged()
PySide6.QtCharts.QBarSet.__lshift__(value)
Parameters

value – float

Return type

PySide6.QtCharts.QBarSet

PySide6.QtCharts.QBarSet.operator[](index)
Parameters

index – int

Return type

float

Returns the value of the bar set specified by index. If the index is out of bounds, 0.0 is returned.

PySide6.QtCharts.QBarSet.pen()
Return type

PySide6.QtGui.QPen

This property holds The pen used to draw the lines of bars in the bar set..

PySide6.QtCharts.QBarSet.penChanged()
PySide6.QtCharts.QBarSet.pressed(index)
Parameters

index – int

PySide6.QtCharts.QBarSet.released(index)
Parameters

index – int

PySide6.QtCharts.QBarSet.remove(index[, count=1])
Parameters
  • index – int

  • count – int

Removes the number of values specified by count from the bar set starting with the value specified by index.

See also

insert()

PySide6.QtCharts.QBarSet.replace(index, value)
Parameters
  • index – int

  • value – float

Adds the value specified by value to the bar set at the position specified by index.

PySide6.QtCharts.QBarSet.selectAllBars()

Marks all bars in the series as selected.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.selectBar(index)
Parameters

index – int

Marks the bar at index as selected.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.selectBars(indexes)
Parameters

indexes

Marks multiple bars passed in an indexes list as selected.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.selectedBars()
Return type

Returns a list of bars marked as selected.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.selectedBarsChanged(indexes)
Parameters

indexes

PySide6.QtCharts.QBarSet.selectedColor()
Return type

PySide6.QtGui.QColor

Returns the color of the selected bars.

This is the fill (brush) color of bars marked as selected. If not specified, value of color is used as default.

PySide6.QtCharts.QBarSet.selectedColorChanged(color)
Parameters

colorPySide6.QtGui.QColor

PySide6.QtCharts.QBarSet.setBarSelected(index, selected)
Parameters
  • index – int

  • selected – bool

Marks the bar at index as either selected or deselected as specified by selected.

Note

Selected bars are drawn using the selected color if it was specified. Emits QBarSet::selectedBarsChanged.

PySide6.QtCharts.QBarSet.setBorderColor(color)
Parameters

colorPySide6.QtGui.QColor

This property holds The line (pen) color of the bar set..

PySide6.QtCharts.QBarSet.setBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

This property holds The brush used to fill the bars in the bar set..

PySide6.QtCharts.QBarSet.setColor(color)
Parameters

colorPySide6.QtGui.QColor

This property holds The fill (brush) color of the bar set..

PySide6.QtCharts.QBarSet.setLabel(label)
Parameters

label – str

This property holds The label of the bar set..

PySide6.QtCharts.QBarSet.setLabelBrush(brush)
Parameters

brushPySide6.QtGui.QBrush

This property holds The brush used to draw the bar set’s label..

PySide6.QtCharts.QBarSet.setLabelColor(color)
Parameters

colorPySide6.QtGui.QColor

This property holds The text (label) color of the bar set..

PySide6.QtCharts.QBarSet.setLabelFont(font)
Parameters

fontPySide6.QtGui.QFont

This property holds The font used to draw the bar set’s label..

PySide6.QtCharts.QBarSet.setPen(pen)
Parameters

penPySide6.QtGui.QPen

This property holds The pen used to draw the lines of bars in the bar set..

PySide6.QtCharts.QBarSet.setSelectedColor(color)
Parameters

colorPySide6.QtGui.QColor

Sets the color of the selected bars.

See also

selectedColor

PySide6.QtCharts.QBarSet.sum()
Return type

float

Returns the sum of all values in the bar set.

PySide6.QtCharts.QBarSet.toggleSelection(indexes)
Parameters

indexes

Changes the selection state of bars at the given indexes to the opposite one.

Note

Emits QBarSet::selectedBarsChanged.

See also

setBarSelected()

PySide6.QtCharts.QBarSet.valueChanged(index)
Parameters

index – int

PySide6.QtCharts.QBarSet.valuesAdded(index, count)
Parameters
  • index – int

  • count – int

PySide6.QtCharts.QBarSet.valuesRemoved(index, count)
Parameters
  • index – int

  • count – int