QBarSet Class▲
-
Header: QBarSet
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
-
qmake: QT += graphs
-
Inherited By:
-
Instantiated By: qml-qtgraphs-barset.xml
-
Inherits: QObject
-
Group: QBarSet is part of Qt Graphs C++ Classes for 2D
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▲
See also QAbstractBarSeries, QBarSeries
Property Documentation▲
borderColor : QColor▲
This property holds the border color of the bar set.
Access functions:
-
void setBorderColor( color)
Notifier signal:
-
void borderColorChanged( color)
borderWidth : qreal▲
This property holds the width of the border line. By default, the width is -1, meaning the border width is defined by the theme.
Access functions:
-
borderWidth() const
-
void setBorderWidth( borderWidth)
Notifier signal:
-
void borderWidthChanged( width)
color : QColor▲
This property holds the fill color of the bar set.
Access functions:
Notifier signal:
-
void colorChanged( color)
[read-only] count : const int▲
This property holds the number of values in the bar set.
Access functions:
-
int count() const
Notifier signal:
-
void countChanged()
label : QString▲
This property holds the label of the bar set.
Access functions:
Notifier signal:
-
void labelChanged()
labelColor : QColor▲
This property holds the text (label) color of the bar set.
Access functions:
-
void setLabelColor( color)
Notifier signal:
-
void labelColorChanged( color)
[read-only] selectedBars : const QList<int>▲
This property holds the indexes of the bars which are currently selected.
Access functions:
-
<int> selectedBars() const
Notifier signal:
-
void selectedBarsChanged(const <int> &indexes)
Member Function Documentation▲
[explicit] QBarSet::QBarSet(const QString label, QObject *parent = nullptr)▲
Constructs a bar set with the label label and the parent parent.
[virtual] QBarSet::~QBarSet()▲
Removes the bar set.
void QBarSet::append(const qreal value)▲
Appends the new value specified by value to the end of the bar set.
void QBarSet::append(const QList<qreal> &values)▲
Appends the list of real values specified by values to the end of the bar set.
See Also▲
See also append()
qreal QBarSet::at(const int index) const▲
Returns the value specified by index from the bar set. If the index is out of bounds, 0.0 is returned.
QColor QBarSet::borderColor()▲
Returns the line color for the bar set.
Getter function for property borderColor.
See Also▲
See also setBorderColor()
void QBarSet::borderColorChanged(QColor color)▲
This signal is emitted when the border color of the bar set changes to color.
Notifier signal for property borderColor.
QColor QBarSet::color()▲
Returns the fill color for the bar set.
Getter function for property color.
See Also▲
See also setColor()
void QBarSet::colorChanged(QColor color)▲
This signal is emitted when the fill color of the bar set changes to color.
Notifier signal for property color.
int QBarSet::count() const▲
Returns the number of values in a bar set.
Getter function for property count.
void QBarSet::deselectAllBars()▲
Deselects all bars in the series.
Emits QBarSet::selectedBarsChanged.
See Also▲
See also setBarSelected()
void QBarSet::deselectBar(int index)▲
void QBarSet::deselectBars(const QList<int> &indexes)▲
Marks multiple bars passed in an indexes list as deselected.
Emits QBarSet::selectedBarsChanged.
See Also▲
See also setBarSelected()
void QBarSet::insert(const int index, const qreal value)▲
Inserts value in the position specified by index. The values following the inserted value are moved up one position.
See Also▲
See also remove()
bool QBarSet::isBarSelected(int index) const▲
Returns true if the bar at the given index is among selected bars and false otherwise.
Selected bars are drawn using the selected color if it was specified using QBarSet::setSelectedColor.
See Also▲
See also selectedBars(), setBarSelected(), setSelectedColor()
QString QBarSet::label() const▲
void QBarSet::labelChanged()▲
This signal is emitted when the label of the bar set changes.
Notifier signal for property label.
See Also▲
See also label
QColor QBarSet::labelColor()▲
Returns the text color for the bar set.
Getter function for property labelColor.
See Also▲
See also setLabelColor()
void QBarSet::labelColorChanged(QColor color)▲
This signal is emitted when the text (label) color of the bar set changes to color.
Notifier signal for property labelColor.
void QBarSet::remove(const int index, const int count = 1)▲
Removes the number of values specified by count from the bar set starting with the value specified by index.
See Also▲
See also insert()
void QBarSet::replace(const int index, const qreal value)▲
Adds the value specified by value to the bar set at the position specified by index.
void QBarSet::selectAllBars()▲
Marks all bars in the series as selected.
Emits QBarSet::selectedBarsChanged.
See Also▲
See also setBarSelected()
void QBarSet::selectBar(int index)▲
Marks the bar at index as selected.
Emits QBarSet::selectedBarsChanged.
See Also▲
See also setBarSelected()
void QBarSet::selectBars(const QList<int> &indexes)▲
Marks multiple bars passed in an indexes list as selected.
Emits QBarSet::selectedBarsChanged.
See Also▲
See also setBarSelected()
QList<int> QBarSet::selectedBars() const▲
Returns a list of bars marked as selected.
Getter function for property selectedBars.
See Also▲
See also setBarSelected()
QColor QBarSet::selectedColor() const▲
Returns the color of the selected bars.
This is the fill (brush) color of bars marked as selected. If not specified, value of QBarSet::color is used as default.
See Also▲
See also setSelectedColor(), color
void QBarSet::setBarSelected(int index, bool selected)▲
Marks the bar at index as either selected or deselected as specified by selected.
Selected bars are drawn using the selected color if it was specified. Emits QBarSet::selectedBarsChanged.
See Also▲
See also isBarSelected(), setSelectedColor()
void QBarSet::setBorderColor(QColor color)▲
Sets the line color for the bar set to color.
Setter function for property borderColor.
See Also▲
See also borderColor()
void QBarSet::setColor(QColor color)▲
Sets the fill color for the bar set to color.
Setter function for property color.
See Also▲
See also color()
void QBarSet::setLabel(const QString label)▲
Sets label as the new label for the bar set.
Setter function for property label.
See Also▲
See also label()
void QBarSet::setLabelColor(QColor color)▲
Sets the text color for the bar set to color.
Setter function for property labelColor.
See Also▲
See also labelColor()
void QBarSet::setSelectedColor(const QColor &color)▲
qreal QBarSet::sum() const▲
Returns the sum of all values in the bar set.
void QBarSet::toggleSelection(const QList<int> &indexes)▲
Changes the selection state of bars at the given indexes to the opposite one.
Emits QBarSet::selectedBarsChanged.
See Also▲
See also setBarSelected()
void QBarSet::valueChanged(int index)▲
This signal is emitted when the value at the position specified by index is modified.
See Also▲
See also at()
void QBarSet::valuesAdded(int index, int count)▲
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.
See Also▲
void QBarSet::valuesChanged()▲
This signal is emitted when the values of the bar set change.
Notifier signal for property values.
void QBarSet::valuesRemoved(int index, int count)▲
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▲
See also remove()
QBarSet &QBarSet::operator<<(const qreal &value)▲
A convenience operator for appending the real value specified by value to the end of the bar set.
See Also▲
See also append()
qreal QBarSet::operator[](const int index) const▲
Returns the value of the bar set specified by index. If the index is out of bounds, 0.0 is returned.