QBarSet#
The QBarSet
class represents one set of bars in a bar chart. More…
Synopsis#
Properties#
borderColor
- Line (pen) color of the bar setbrush
- Used to fill the bars in the bar setcolor
- Fill (brush) color of the bar setlabel
- Of the bar setlabelBrush
- Brush used to draw the bar set’s labellabelColor
- Text (label) color of the bar setlabelFont
- Font used to draw the bar set’s labelpen
- Used to draw the lines of bars in the bar set
Functions#
def
append
(value)def
append
(values)def
at
(index)def
borderColor
()def
brush
()def
color
()def
count
()def
deselectAllBars
()def
deselectBar
(index)def
deselectBars
(indexes)def
insert
(index, value)def
isBarSelected
(index)def
label
()def
labelBrush
()def
labelColor
()def
labelFont
()def
__lshift__
(value)def
operator[]
(index)def
pen
()def
remove
(index[, count=1])def
replace
(index, value)def
selectAllBars
()def
selectBar
(index)def
selectBars
(indexes)def
selectedBars
()def
selectedColor
()def
setBarSelected
(index, selected)def
setBorderColor
(color)def
setBrush
(brush)def
setColor
(color)def
setLabel
(label)def
setLabelBrush
(brush)def
setLabelColor
(color)def
setLabelFont
(font)def
setPen
(pen)def
setSelectedColor
(color)def
sum
()def
toggleSelection
(indexes)
Signals#
def
borderColorChanged
(color)def
brushChanged
()def
clicked
(index)def
colorChanged
(color)def
doubleClicked
(index)def
hovered
(status, index)def
labelBrushChanged
()def
labelChanged
()def
labelColorChanged
(color)def
labelFontChanged
()def
penChanged
()def
pressed
(index)def
released
(index)def
selectedBarsChanged
(indexes)def
selectedColorChanged
(color)def
valueChanged
(index)def
valuesAdded
(index, count)def
valuesRemoved
(index, count)
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 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:
label – str
parent –
PySide6.QtCore.QObject
Constructs a bar set with the label label
and the parent parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtCharts.QBarSet.borderColor: PySide6.QtGui.QColor#
This property holds The line (pen) color of the bar set..
- Access functions:
borderColor
()setBorderColor
(color)Signal
borderColorChanged
(color)
- property PᅟySide6.QtCharts.QBarSet.brush: PySide6.QtGui.QBrush#
This property holds The brush used to fill the bars in the bar set..
- Access functions:
brush
()setBrush
(brush)Signal
brushChanged
()
- property PᅟySide6.QtCharts.QBarSet.color: PySide6.QtGui.QColor#
This property holds The fill (brush) color of the bar set..
- Access functions:
color
()setColor
(color)Signal
colorChanged
(color)
- property PᅟySide6.QtCharts.QBarSet.label: str#
This property holds The label of the bar set..
- Access functions:
label
()setLabel
(label)Signal
labelChanged
()
- property PᅟySide6.QtCharts.QBarSet.labelBrush: PySide6.QtGui.QBrush#
This property holds The brush used to draw the bar set’s label..
- Access functions:
labelBrush
()setLabelBrush
(brush)Signal
labelBrushChanged
()
- property PᅟySide6.QtCharts.QBarSet.labelColor: PySide6.QtGui.QColor#
This property holds The text (label) color of the bar set..
- Access functions:
labelColor
()setLabelColor
(color)Signal
labelColorChanged
(color)
- property PᅟySide6.QtCharts.QBarSet.labelFont: PySide6.QtGui.QFont#
This property holds The font used to draw the bar set’s label..
- Access functions:
labelFont
()setLabelFont
(font)Signal
labelFontChanged
()
- property PᅟySide6.QtCharts.QBarSet.pen: PySide6.QtGui.QPen#
This property holds The pen used to draw the lines of bars in the bar set..
- Access functions:
pen
()setPen
(pen)Signal
penChanged
()
- 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.append(values)
- Parameters:
values –
Appends the list of real values specified by values
to the end of the bar set.
See also
- 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:
Returns the line color for the bar set.
See also
Getter of property borderColor
.
- PySide6.QtCharts.QBarSet.borderColorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
This signal is emitted when the line (pen) color of the bar set changes to color
.
Notification signal of property borderColor
.
- PySide6.QtCharts.QBarSet.brush()#
- Return type:
Returns the brush used to fill the bars in the bar set.
See also
Getter of property brush
.
- PySide6.QtCharts.QBarSet.brushChanged()#
This signal is emitted when the brush used to draw the bar set changes.
See also
Notification signal of property brush
.
- PySide6.QtCharts.QBarSet.clicked(index)#
- Parameters:
index – int
This signal is emitted when the user clicks the bar specified by index
in a bar set.
- PySide6.QtCharts.QBarSet.color()#
- Return type:
Returns the fill color for the bar set.
See also
Getter of property color
.
- PySide6.QtCharts.QBarSet.colorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
This signal is emitted when the fill (brush) color of the bar set changes to color
.
Notification signal of property color
.
- 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.
- PySide6.QtCharts.QBarSet.deselectBar(index)#
- Parameters:
index – int
Deselects the bar at index
.
- PySide6.QtCharts.QBarSet.deselectBars(indexes)#
- Parameters:
indexes –
Marks multiple bars passed in an indexes
list as deselected.
- PySide6.QtCharts.QBarSet.doubleClicked(index)#
- Parameters:
index – int
This signal is emitted when the user double-clicks the bar specified by index
in a bar set.
- PySide6.QtCharts.QBarSet.hovered(status, index)#
- Parameters:
status – bool
index – int
This signal is emitted when a mouse is hovered over the bar specified by index
in a bar set. When the mouse moves over the bar, status
turns true
, and when the mouse moves away again, it turns false
.
- 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
- 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
Returns the label of the bar set.
See also
Getter of property label
.
- PySide6.QtCharts.QBarSet.labelBrush()#
- Return type:
Returns the brush used to draw values on top of this bar set.
See also
Getter of property labelBrush
.
- PySide6.QtCharts.QBarSet.labelBrushChanged()#
This signal is emitted when the brush used to draw the bar set’s label changes.
See also
Notification signal of property labelBrush
.
- PySide6.QtCharts.QBarSet.labelChanged()#
This signal is emitted when the label of the bar set changes.
See also
Notification signal of property label
.
- PySide6.QtCharts.QBarSet.labelColor()#
- Return type:
Returns the text color for the bar set.
See also
Getter of property labelColor
.
- PySide6.QtCharts.QBarSet.labelColorChanged(color)#
- Parameters:
color –
PySide6.QtGui.QColor
This signal is emitted when the text (label) color of the bar set changes to color
.
Notification signal of property labelColor
.
- PySide6.QtCharts.QBarSet.labelFont()#
- Return type:
Returns the pen used to draw values on top of this bar set.
See also
Getter of property labelFont
.
- PySide6.QtCharts.QBarSet.labelFontChanged()#
This signal is emitted when the font of the bar set’s label changes.
See also
Notification signal of property labelFont
.
- PySide6.QtCharts.QBarSet.__lshift__(value)#
- Parameters:
value – float
- Return type:
A convenience operator for appending the real value specified by value
to the end of the bar set.
See also
- 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:
Returns the pen used to draw the lines in the bar set.
See also
Getter of property pen
.
- PySide6.QtCharts.QBarSet.penChanged()#
This signal is emitted when the pen used to draw the bar set changes.
See also
Notification signal of property pen
.
- PySide6.QtCharts.QBarSet.pressed(index)#
- Parameters:
index – int
This signal is emitted when the user clicks the bar specified by index
in a bar set and holds down the mouse button.
- PySide6.QtCharts.QBarSet.released(index)#
- Parameters:
index – int
This signal is emitted when the user releases the mouse press on the bar specified by index
in a bar set.
- 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
- 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.
- PySide6.QtCharts.QBarSet.selectBar(index)#
- Parameters:
index – int
Marks the bar at index
as selected.
- PySide6.QtCharts.QBarSet.selectBars(indexes)#
- Parameters:
indexes –
Marks multiple bars passed in an indexes
list as selected.
- PySide6.QtCharts.QBarSet.selectedBars()#
Returns a list of bars marked as selected.
See also
- PySide6.QtCharts.QBarSet.selectedBarsChanged(indexes)#
- Parameters:
indexes –
- PySide6.QtCharts.QBarSet.selectedColor()#
- Return type:
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.
See also
- PySide6.QtCharts.QBarSet.selectedColorChanged(color)#
- Parameters:
color –
PySide6.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.
See also
- PySide6.QtCharts.QBarSet.setBorderColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
Sets the line color for the bar set to color
.
See also
Setter of property borderColor
.
- PySide6.QtCharts.QBarSet.setBrush(brush)#
- Parameters:
brush –
PySide6.QtGui.QBrush
Sets the brush used to fill the bars in the bar set to brush
.
See also
Setter of property brush
.
- PySide6.QtCharts.QBarSet.setColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
Sets the fill color for the bar set to color
.
See also
Setter of property color
.
- PySide6.QtCharts.QBarSet.setLabel(label)#
- Parameters:
label – str
Sets label
as the new label for the bar set.
See also
Setter of property label
.
- PySide6.QtCharts.QBarSet.setLabelBrush(brush)#
- Parameters:
brush –
PySide6.QtGui.QBrush
Sets the brush used to draw values on top of this bar set to brush
.
See also
Setter of property labelBrush
.
- PySide6.QtCharts.QBarSet.setLabelColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
Sets the text color for the bar set to color
.
See also
Setter of property labelColor
.
- PySide6.QtCharts.QBarSet.setLabelFont(font)#
- Parameters:
font –
PySide6.QtGui.QFont
Sets the font used to draw values on top of this bar set to font
.
See also
Setter of property labelFont
.
- PySide6.QtCharts.QBarSet.setPen(pen)#
- Parameters:
pen –
PySide6.QtGui.QPen
Sets the pen used to draw the lines in the bar set to pen
.
See also
Setter of property pen
.
- PySide6.QtCharts.QBarSet.setSelectedColor(color)#
- Parameters:
color –
PySide6.QtGui.QColor
Sets the color
of the selected bars.
See also
- 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.
- PySide6.QtCharts.QBarSet.valueChanged(index)#
- Parameters:
index – int
This signal is emitted when the value at the position specified by index
is modified.
See also
- PySide6.QtCharts.QBarSet.valuesAdded(index, count)#
- Parameters:
index – int
count – int
This signal is emitted when new values are added to the bar set. index
indicates the position of the first inserted value, and count
is the number of inserted values.
- PySide6.QtCharts.QBarSet.valuesRemoved(index, count)#
- Parameters:
index – int
count – int
This signal is emitted when values are removed from the bar set. index
indicates the position of the first removed value, and count
is the number of removed values.
See also