BarSet QML Type

代表条形图中的一组条形。更多

Import Statement: import QtCharts 2.9
In C++: QBarSet

属性

信号

方法

详细说明

条形集包含每个类别的一个数据值。假设数据集的第一个值属于第一个类别,第二个值属于第二个类别,以此类推。如果数据集的数据值少于类别数,则缺失的数据值会被认为位于数据集的末尾。对于位于集合中间的缺失值,则使用数值 0。不显示零值集的标签。

另请参阅 AbstractBarSeries,BarSeries,StackedBarSeries,PercentBarSeries,HorizontalBarSeries,HorizontalStackedBarSeries, 和HorizontalPercentBarSeries

属性文档

borderColor : color

条形图集的线(笔)颜色。


borderWidth : real

边框线的宽度。默认宽度为 2.0。


brushFilename : string

用作条形集笔刷的文件名。


color : color

条形图组的填充(笔刷)颜色。


count : int

条形图组中数值的个数。


label : string

条形图组的标签。


labelColor : color

条形集的文本(标签)颜色。


labelFont : font

用于绘制条形集标签的字体。

更多信息,请参阅font


values : list<var>

条形集的值。您可以将realpoint 类型的列表设置为值。

如果将一系列实数类型设置为值,它们将直接定义条形集值。

如果将点类型列表设置为值,则点的 x 坐标将指定其在条形集中的零基索引。条形集的大小为最高 x 坐标值 + 1。如果在零和最高值之间的任何 x 坐标上缺少一个点,则该点的值为零。

例如,以下条形集的值相等:

myBarSet1.values = [5, 0, 1, 5];
myBarSet2.values = [Qt.point(0, 5), Qt.point(2, 1), Qt.point(3, 5)];

信号文档

valueChanged(int index)

index 指定位置的值被修改时,将发出该信号。

相应的信号处理程序是onValueChanged

注: 相应的处理程序是onValueChanged


valuesAdded(int index, int count)

index 表示第一个插入值的位置,count 是插入值的个数。

相应的信号处理程序是onValuesAdded

注: 相应的处理程序是onValuesAdded


valuesRemoved(int index, int count)

index 表示第一个删除值的位置,count 是删除值的个数。

相应的信号处理程序是onValuesRemoved

注: 相应的处理程序是onValuesRemoved


方法文档

append(real value)

value 指定的新值添加到条形图集的末尾。


at(int index)

从条形集中返回index 指定的值。如果索引超出范围,则返回 0.0。


clicked(int index)

当用户点击条形图集中由index 指定的条形图时,就会发出该信号。

相应的信号处理程序是onClicked


doubleClicked(int index)

当用户双击条形图集中由index 指定的条形图时,将发出该信号。

相应的信号处理程序是onDoubleClicked


pressed(int index)

当用户点击条形图组中由index 指定的条形图并按住鼠标键时,将发出该信号。

相应的信号处理器是onPressed


released(int index)

当用户在条形图集index 指定的条形图上松开鼠标键时,将发出该信号。

相应的信号处理程序是onReleased


remove(int index, int count)

index 指定的值开始,从条形图组中删除count 指定的值的个数。

如果省略count ,则只删除index 指定的值。


replace(int index, real value)

index 指定的位置向条形集添加value 指定的值。


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