QBoxPlotSeries Class
QBoxPlotSeries 类可在箱形图表中显示数据。更多
Header: | #include <QBoxPlotSeries> |
In QML: | BoxPlotSeries |
Inherits: | QAbstractSeries |
属性
|
公共函数
QBoxPlotSeries(QObject *parent = nullptr) | |
virtual | ~QBoxPlotSeries() |
bool | append(QBoxSet *set) |
bool | append(const QList<QBoxSet *> &sets) |
bool | boxOutlineVisible() |
QList<QBoxSet *> | boxSets() const |
qreal | boxWidth() |
QBrush | brush() const |
void | clear() |
int | count() const |
bool | insert(int index, QBoxSet *set) |
QPen | pen() const |
bool | remove(QBoxSet *set) |
void | setBoxOutlineVisible(bool visible) |
void | setBoxWidth(qreal width) |
void | setBrush(const QBrush &brush) |
void | setPen(const QPen &pen) |
bool | take(QBoxSet *set) |
重新实现的公共函数
virtual QAbstractSeries::SeriesType | type() const override |
信号
void | boxOutlineVisibilityChanged() |
void | boxWidthChanged() |
void | boxsetsAdded(const QList<QBoxSet *> &sets) |
void | boxsetsRemoved(const QList<QBoxSet *> &sets) |
void | brushChanged() |
void | clicked(QBoxSet *boxset) |
void | countChanged() |
void | doubleClicked(QBoxSet *boxset) |
void | hovered(bool status, QBoxSet *boxset) |
void | penChanged() |
void | pressed(QBoxSet *boxset) |
void | released(QBoxSet *boxset) |
详细说明
箱形图系列是箱形须项的容器。多个系列中的项目会根据其索引值归类。
QBarCategoryAxis 类用于将类别添加到图表的坐标轴上。类别标签必须是唯一的。如果为多个方框-须项目定义了相同的类别标签,则只会绘制第一个类别标签。
请参阅 "带 Widgets 的图表图库",了解如何创建盒状须线图。
另请参阅 QBoxSet 和QBarCategoryAxis 。
属性文档
boxOutlineVisible : bool
该属性用于设置方框轮廓的可见度。
访问功能:
bool | boxOutlineVisible() |
void | setBoxOutlineVisible(bool visible) |
通知信号:
void | boxOutlineVisibilityChanged() |
boxWidth : qreal
该属性用于保存盒须条目的宽度。该值表示项目在其类别中的相对宽度。该值介于 0.0 和 1.0 之间。负值用 0.0 代替,大于 1.0 的值用 1.0 代替。
访问功能:
qreal | boxWidth() |
void | setBoxWidth(qreal width) |
通知信号:
void | boxWidthChanged() |
brush : QBrush
此属性保存用于填充方框-和须项目方框的笔刷。
访问功能:
QBrush | brush() const |
void | setBrush(const QBrush &brush) |
通知信号:
void | brushChanged() |
[read-only]
count : const int
该属性用于保存盒状图序列中盒须项的数量。
访问功能:
int | count() const |
通知信号:
void | countChanged() |
pen : QPen
该属性保存用于绘制方框-和须项目线条的笔。
访问功能:
QPen | pen() const |
void | setPen(const QPen &pen) |
Notifier 信号:
void | penChanged() |
成员函数 文档
[explicit]
QBoxPlotSeries::QBoxPlotSeries(QObject *parent = nullptr)
构建一个空箱图序列,该序列是QObject 和parent 的子序列。
[virtual noexcept]
QBoxPlotSeries::~QBoxPlotSeries()
从图表中删除系列。
bool QBoxPlotSeries::append(QBoxSet *set)
将set 指定的单个方括号项目添加到系列中,并获得其所有权。如果项目为空或已属于系列,则不会添加。如果追加成功,则返回true
。
bool QBoxPlotSeries::append(const QList<QBoxSet *> &sets)
将sets 指定的盒须项目列表添加到系列中,并获得其所有权。如果列表为空或项目已属于系列,则不会添加。如果追加成功,则返回true
。
[signal]
void QBoxPlotSeries::boxOutlineVisibilityChanged()
当方框轮廓的可见性发生变化时会发出该信号。
注: 属性boxOutlineVisible 的通知信号。
QList<QBoxSet *> QBoxPlotSeries::boxSets() const
返回盒状图序列中的盒状须项列表。保留项的所有权。
[signal]
void QBoxPlotSeries::boxWidthChanged()
当盒须项目的宽度发生变化时会发出该信号。
注: 属性boxWidth 的通知信号。
[signal]
void QBoxPlotSeries::boxsetsAdded(const QList<QBoxSet *> &sets)
当sets 指定的方括号项目列表添加到系列中时,会发出该信号。
[signal]
void QBoxPlotSeries::boxsetsRemoved(const QList<QBoxSet *> &sets)
当sets 指定的方括号项目列表从系列中删除时,会发出该信号。
[signal]
void QBoxPlotSeries::brushChanged()
当用于填充方框和胡须项目方框的笔刷发生变化时,将发出该信号。
注: 用于属性brush 的通知信号。
void QBoxPlotSeries::clear()
删除系列中的所有方框和胡须项目,并将其永久删除。
[signal]
void QBoxPlotSeries::clicked(QBoxSet *boxset)
当用户在图表中点击boxset 指定的方框-须项时会发出该信号。
int QBoxPlotSeries::count() const
返回盒状图序列中盒须项的数量。
注: 属性计数的获取函数。
[signal]
void QBoxPlotSeries::countChanged()
当系列中的方括号项目数发生变化时,将发出该信号。
注: 属性count 的通知信号。
[signal]
void QBoxPlotSeries::doubleClicked(QBoxSet *boxset)
当用户在图表中双击boxset 所指定的方框-须项时会发出该信号。
[signal]
void QBoxPlotSeries::hovered(bool status, QBoxSet *boxset)
当鼠标悬停在图表中boxset 所指定的方框-胡须项上时,就会发出该信号。当鼠标移到该项目上时,status 变成true
,当鼠标再次移开时,变成false
。
bool QBoxPlotSeries::insert(int index, QBoxSet *set)
在index 指定的位置将set 指定的方括号项目插入系列,并取得项目的所有权。如果项目为空或已属于序列,则不会被添加。如果插入成功,则返回true
。
[signal]
void QBoxPlotSeries::penChanged()
当用于绘制方括号项目线条的笔发生变化时,会发出该信号。
注: 属性pen 的通知信号。
[signal]
void QBoxPlotSeries::pressed(QBoxSet *boxset)
当用户在图表中点击boxset 指定的方框-须项并按住鼠标键时,就会发出该信号。
[signal]
void QBoxPlotSeries::released(QBoxSet *boxset)
当用户松开按在图表中boxset 所指定的方括号项目上的鼠标时,就会发出该信号。
bool QBoxPlotSeries::remove(QBoxSet *set)
从系列中删除set 指定的方括号项目,如果删除成功,则永久删除该项目。如果项目已删除,则返回true
。
bool QBoxPlotSeries::take(QBoxSet *set)
从系列中删除set 指定的方括号项目。不会删除项目。
注: 系列仍是项目的父对象。您必须设置父对象以获得完全所有权。
如果删除操作成功,则返回true
。
[override virtual]
QAbstractSeries::SeriesType QBoxPlotSeries::type() const
重构属性访问函数:QAbstractSeries::type 。
返回系列的类型。
另请参阅 QAbstractSeries 和SeriesType 。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.