- class QBarSet¶
The
QBarSet
class represents one set of bars in a bar graph. More…Synopsis¶
Properties¶
borderColorᅟ
- Border color of the bar setcolorᅟ
- Fill color of the bar setlabelᅟ
- Of the bar setlabelColorᅟ
- Text (label) color of the bar set
Methods¶
def
__init__()
def
append()
def
at()
def
borderColor()
def
brush()
def
color()
def
count()
def
deselectBar()
def
deselectBars()
def
insert()
def
isBarSelected()
def
label()
def
labelBrush()
def
labelColor()
def
labelFont()
def
operator[]()
def
pen()
def
remove()
def
replace()
def
selectAllBars()
def
selectBar()
def
selectBars()
def
selectedBars()
def
selectedColor()
def
setBarSelected()
def
setBorderColor()
def
setBrush()
def
setColor()
def
setLabel()
def
setLabelBrush()
def
setLabelColor()
def
setLabelFont()
def
setPen()
def
sum()
Signals¶
def
brushChanged()
def
clicked()
def
colorChanged()
def
doubleClicked()
def
hovered()
def
labelChanged()
def
penChanged()
def
pressed()
def
released()
def
valueChanged()
def
valuesAdded()
def
valuesRemoved()
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.
See also
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.This property holds The border color of the bar set..
- Access functions:
- Access functions:
Signal
brushChanged()
This property holds The fill color of the bar set..
- Access functions:
Signal
colorChanged()
- property labelᅟ: str¶
This property holds The label of the bar set..
- Access functions:
Signal
labelChanged()
- Access functions:
This property holds The text (label) color of the bar set..
- Access functions:
- Access functions:
- Access functions:
Signal
penChanged()
Constructs a bar set with the label
label
and the parentparent
.- append(values)¶
- Parameters:
values – .list of qreal
Appends the list of real values specified by
values
to the end of the bar set.See also
- append(value)
- Parameters:
value – float
- 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.Getter of property
borderColorᅟ
.Notification signal of property
borderColorᅟ
.Getter of property
brushᅟ
.- brushChanged()¶
Notification signal of property
brushᅟ
.- clicked(index)¶
- Parameters:
index – int
Getter of property
colorᅟ
.Notification signal of property
colorᅟ
.- count()¶
- Return type:
int
Returns the number of values in a bar set.
- deselectAllBars()¶
Deselects all bars in the set.
- deselectBar(index)¶
- Parameters:
index – int
Deselects the bar at
index
.- deselectBars(indexes)¶
- Parameters:
indexes – .list of int
Marks multiple bars passed in an
indexes
list as deselected.- doubleClicked(index)¶
- Parameters:
index – int
- hovered(status, index)¶
- Parameters:
status – bool
index – int
- insert(index, value)¶
- Parameters:
index – int
value – float
Inserts
value
in the position specified byindex
. The values following the inserted value are moved up one position.See also
- isBarSelected(index)¶
- Parameters:
index – int
- Return type:
bool
Returns
true
if the bar at the givenindex
is among selected bars andfalse
otherwise.Note
Selected bars are drawn using the selected color if it was specified using
setSelectedColor
.- label()¶
- Return type:
str
Returns the label of the bar set.
See also
Getter of property
labelᅟ
.Getter of property
labelBrushᅟ
.- labelBrushChanged()¶
Notification signal of property
labelBrushᅟ
.- labelChanged()¶
Notification signal of property
labelᅟ
.Getter of property
labelColorᅟ
.Notification signal of property
labelColorᅟ
.Getter of property
labelFontᅟ
.- labelFontChanged()¶
Notification signal of property
labelFontᅟ
.- 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.Getter of property
penᅟ
.- penChanged()¶
Notification signal of property
penᅟ
.- pressed(index)¶
- Parameters:
index – int
- released(index)¶
- Parameters:
index – int
- 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 byindex
.See also
- replace(index, value)¶
- Parameters:
index – int
value – float
Adds the value specified by
value
to the bar set at the position specified byindex
.- selectAllBars()¶
Marks all bars in the set as selected.
- selectBar(index)¶
- Parameters:
index – int
Marks the bar at
index
as selected.- selectBars(indexes)¶
- Parameters:
indexes – .list of int
Marks multiple bars passed in an
indexes
list as selected.- selectedBars()¶
- Return type:
.list of int
Returns a list of bars marked as selected.
See also
- selectedBarsChanged(indexes)¶
- Parameters:
indexes – .list of int
This signal is emitted when the selected bar changes.
indexes
is a list selected bar indexes.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
- setBarSelected(index, selected)¶
- Parameters:
index – int
selected – bool
Marks the bar at
index
as either selected or deselected as specified byselected
.Note
Selected bars are drawn using the selected color if it was specified. Emits
selectedBarsChanged
.See also
Sets the line color for the bar set to
color
.See also
Setter of property
borderColorᅟ
.Setter of property
brushᅟ
.Sets the fill color for the bar set to
color
.See also
Setter of property
colorᅟ
.- setLabel(label)¶
- Parameters:
label – str
Sets
label
as the new label for the bar set.See also
Setter of property
labelᅟ
.Setter of property
labelBrushᅟ
.Sets the text color for the bar set to
color
.See also
Setter of property
labelColorᅟ
.Setter of property
labelFontᅟ
.Setter of property
penᅟ
.Sets the
color
of the selected bars.See also
- sum()¶
- Return type:
float
Returns the sum of all values in the bar set.
- toggleSelection(indexes)¶
- Parameters:
indexes – .list of int
Changes the selection state of bars at the given
indexes
to the opposite one.- valueChanged(index)¶
- Parameters:
index – int
This signal is emitted when the value at the position specified by
index
is modified.See also
- 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, andcount
is the number of inserted values.- 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, andcount
is the number of removed values.See also