本页内容

QHorizontalPercentBarSeries Class

QHorizontalPercentBarSeries 类将一系列分类数据以各分类所占百分比的形式呈现。更多内容...

Header: #include <QHorizontalPercentBarSeries>
In QML: HorizontalPercentBarSeries
Inherits: QAbstractBarSeries
Status: Deprecated

该类已弃用。我们强烈建议不要在新代码中使用它。

公共函数

QHorizontalPercentBarSeries(QObject *parent = nullptr)
virtual ~QHorizontalPercentBarSeries()

重新实现的公共函数

virtual QAbstractSeries::SeriesType type() const override

详细说明

该类将数据绘制为一系列尺寸均匀、水平堆叠的条形,每个类别对应一个条形。添加到系列中的每个条形集都会为每个堆叠条形贡献一个分段。分段的大小对应于该分段值占堆叠中所有分段总值的百分比。值为零的条形不会被绘制。

请参阅“带控件的图表”图库,了解如何创建水平百分比条形图。

横向百分比条形图,每个月的条形在五个数据集中均填充至100%

另请参阅 QBarSet 、QBarSeries 、QPercentBarSeries 、QAbstractBarSeries 、QStackedBarSeries 、QHorizontalStackedBarSeries 以及QHorizontalBarSeries 。

成员函数文档

[explicit] QHorizontalPercentBarSeries::QHorizontalPercentBarSeries(QObject *parent = nullptr)

构建一个空的水平百分比条形图系列,该系列属于QObject ,并且是parent 的子对象。

[virtual noexcept] QHorizontalPercentBarSeries::~QHorizontalPercentBarSeries()

从图表中删除条形系列。

[override virtual] QAbstractSeries::SeriesType QHorizontalPercentBarSeries::type() const

重新实现了属性QAbstractSeries::type 的访问函数。

返回水平百分比条形图系列。

© 2026 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.