VBoxPlotModelMapper QML Type
盒状图系列的垂直模型映射器。更多
Import Statement: | import QtCharts 2.9 |
In C++: | QVBoxPlotModelMapper |
属性
- firstBoxSetColumn : int
- firstRow : int
- lastBoxSetColumn : int
- model : SomeModel
- rowCount : int
- series : AbstractBarSeries
详细说明
VBoxPlotModelMapper 类型可将源自QAbstractItemModel 类的数据模型用作图表的数据源。垂直模型映射器用于在数据模型和BoxPlotSeries 类型之间创建连接,这样数据模型中的每一列都定义了一个框-须项,每一行都映射到框-须项的范围和三个中值。
模型和序列属性都可用于操作数据。模型映射器使系列和数据模型保持同步。
模型映射器可确保方框图系列中的所有条形框-须项大小相等。因此,添加或删除箱形图系列中某一箱形须项的值,会导致箱形图系列中所有箱形须项发生相同的变化。
下面的 QML 代码片段创建了一个有三个箱沪线项的箱图序列(假设模型至少有四列)。每个方框-须项包含从第 1 行开始的数据。 项的名称由列标题定义。
BoxPlotSeries { VBoxPlotModelMapper { model: myCustomModel // QAbstractItemModel derived implementation firstBoxSetColumn: 1 lastBoxSetColumn: 3 firstRow: 1 } }
另请参阅 HBoxPlotModelMapper 。
属性文档
firstBoxSetColumn : int |
用于作为第一个方括号项目数据源的模型列。默认值为-1(无效映射)。
firstRow : int |
模型中包含盒状图序列中盒须项第一个值的行。
默认值为 0。
lastBoxSetColumn : int |
模型中用作最后一个箱形须项数据源的列。默认值为-1(无效映射)。
model : SomeModel |
映射器使用的数据模型。您需要实现该模型并将其暴露给 QML。
注意: 模型必须支持添加和删除行或列以及修改单元格中的数据。
rowCount : int |
映射为方框图系列数据的模型行数。
默认值为-1(与模型列数相同)。
series : AbstractBarSeries |
映射器使用的方框图系列。
在向映射器设置时,系列中的所有数据都会被丢弃。指定新系列时,旧系列将被断开(但保留其数据)。
© 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.