Bar3DSeries QML Type (Uncreatable)
表示三维条形图中的数据序列。更多...
| Import Statement: | import QtGraphs |
| In C++: | QBar3DSeries |
| Inherits: |
注意:此为不可创建的类型。无法在 QML 中实例化。
- 所有成员列表(包括继承的成员)
- Bar3DSeries 属于Qt Graphs QML 3D 类型。
属性
- baseColor : color
- baseGradient : Gradient
- colorStyle : GraphsTheme.ColorStyle
- columnLabels : list
- dataArray : BarDataArray
- dataProxy : BarDataProxy
- invalidSelectionPosition : point
- itemLabel : string
- itemLabelFormat : string
- itemLabelVisible : bool
- lightingMode : Abstract3DSeries.LightingMode
(since 6.10) - mesh : Abstract3DSeries.Mesh
- meshAngle : real
- meshRotation : quaternion
- meshSmooth : bool
- multiHighlightColor : color
- multiHighlightGradient : Gradient
- name : string
- rowColors : list<Color>
- rowLabels : list
- selectedBar : point
- singleHighlightColor : color
- singleHighlightGradient : Gradient
- type : Abstract3DSeries.SeriesType
- userDefinedMesh : string
- visible : bool
信号
- baseColorChanged(color color)
- baseGradientChanged(Gradient gradient)
- colorStyleChanged(GraphsTheme.ColorStyle style)
- columnLabelsChanged()
- dataArrayChanged(BarDataArray array)
- dataProxyChanged(BarDataProxy proxy)
- itemLabelChanged(string label)
- itemLabelFormatChanged(string format)
- itemLabelVisibilityChanged(bool visible)
- lightingModeChanged(Abstract3DSeries.LightingMode lightingMode)
(since 6.10) - meshAngleChanged(real angle)
- meshChanged(Abstract3DSeries.Mesh mesh)
- meshRotationChanged(quaternion rotation)
- meshSmoothChanged(bool enabled)
- multiHighlightColorChanged(color color)
- multiHighlightGradientChanged(Gradient gradient)
- nameChanged(string name)
- rowColorsChanged(list<color> rowcolors)
- rowLabelsChanged()
- selectedBarChanged(point position)
- singleHighlightColorChanged(color color)
- singleHighlightGradientChanged(Gradient gradient)
- userDefinedMeshChanged(string fileName)
- visibilityChanged(bool visible)
方法
- void setMeshAxisAndAngle(vector3d axis, real angle)
详细说明
此类用于管理系列特有的视觉元素,以及系列数据(通过数据代理)。
Bar3DSeries 支持以下用于 itemLabelFormat 的格式标签:
| @rowTitle | 来自行轴的标题 |
| @colTitle | 来自列轴的标题 |
| @valueTitle | 值轴的标题 |
| @rowIdx | 可见行索引。使用图表区域设置进行本地化。 |
| @colIdx | 可见列索引。使用图的区域设置进行本地化。 |
| @rowLabel | 来自行轴的标签 |
| @colLabel | 来自列轴的标签 |
| @valueLabel | 使用图表所附值轴的格式进行格式化的项目值。有关更多信息,请参阅labelFormat 。 |
| @seriesName | 数据系列的名称 |
| %<格式规范> | 以指定格式显示的项目值。格式化规则与labelFormat 中的规则相同。 |
如需更完整的说明,请参阅QBar3DSeries 。
另请参阅 Qt Graphs 中的 3D 数据处理。
属性文档
baseColor : color
该系列的基础色。
另请参阅 colorStyle 和GraphsTheme.seriesColors 。
baseGradient : Gradient
该系列的基数梯度。
另请参阅 colorStyle 。
colorStyle : GraphsTheme.ColorStyle
该系列的配色风格。
另请参阅 GraphsTheme.ColorStyle 。
columnLabels : list
数组的可选列标签。该数组中的索引与行中的列索引相对应。如果列表的长度小于最长行,则并非所有列都会获得标签。
dataArray : BarDataArray
保存数据数组的引用。
dataArrayChanged 当数据数组被设置时会触发该信号,除非newDataArray 与前一个完全相同。
注意: 在对 dataArray 进行任何操作之前, 必须为相关的代理创建一个系列。
dataProxy : BarDataProxy
活动数据代理。该序列会接管其上设置的任何代理,并在添加新代理时删除先前设置的代理。代理不能为空,也不能设置为另一个序列。
invalidSelectionPosition : point [read-only]
一个常量属性,用于提供一个无效的选择位置。该位置将被赋值给selectedBar 属性,以清除该系列中的选择。
另请参阅 GraphsItem3D.clearSelection()。
itemLabel : string [read-only]
已格式化的项目标签。如果未选中任何项目,或者所选项目不可见,则返回空字符串。
另请参阅 itemLabelFormat 。
itemLabelFormat : string
该系列中数据项的标签格式。此格式用于单个数据项的标签,例如当选中某项时。该格式的解释方式取决于系列类型。
另请参阅 Bar3DSeries 、Scatter3DSeries 以及Surface3DSeries 。
itemLabelVisible : bool
如果true ,项目标签将在图中作为浮动标签绘制。否则,项目标签不会被绘制。若要在外部控件中显示项目标签,应将此属性设置为false 。默认值为true 。
另请参阅 itemLabelFormat 和itemLabel 。
lightingMode : Abstract3DSeries.LightingMode [since 6.10]
该系列中各项的照明模式。默认值为QAbstract3DSeries::LightingMode::Shaded
该属性在 Qt 6.10 中引入。
另请参阅 QAbstract3DSeries::LightingMode 。
mesh : Abstract3DSeries.Mesh
该系列中各项的网格,或者在Surface3DSeries 的情况下为选择指针。如果网格为Abstract3DSeries.Mesh.UserDefined ,则必须同时设置userDefinedMesh 属性,以便各项能正确渲染。默认值取决于图表类型。
另请参阅 QAbstract3DSeries::Mesh 。
meshAngle : real
一个用于以度为单位定义序列旋转角度的便捷属性。
注意: 读取此属性时 ,系统会根据Abstract3DSeries.meshRotation 的值采用浮点精度进行计算,并始终返回0到360度之间的值。
另请参阅 Abstract3DSeries.meshRotation 。
meshRotation : quaternion
应用于该系列所有项的网格旋转。旋转应为归一化四元数。对于支持单项旋转的系列类型,各旋转值将相互相乘。Bar3DSeries 会忽略任何非绕 y 轴的旋转。Surface3DSeries 仅对选择指针应用旋转。默认不进行旋转。
meshSmooth : bool
如果true ,则使用通过mesh 属性设置的预定义网格的平滑版本。当网格设置为Abstract3DSeries.Mesh.UserDefined 时,此属性不会影响所使用的自定义网格。默认值为false 。
multiHighlightColor : color
该系列中多个项目的突出显示颜色。
另请参阅 colorStyle 和GraphsTheme.multiHighlightColor 。
multiHighlightGradient : Gradient
该系列中多个项目的高亮渐变效果。
另请参阅 colorStyle 和GraphsTheme.multiHighlightGradient 。
name : string
系列名称。可使用标签@seriesName 以项目标签格式显示。
另请参阅 itemLabelFormat 。
rowColors : list<Color>
此属性可用于将数据系列的行绘制为不同的颜色。要使用此属性,必须将GraphsTheme.colorStyle 设置为Uniform 。
注意:如果 已设置该属性,且随后更改了主题,rowColors 列表不会自动清空。
另请参阅 QGraphsTheme::ColorStyle::Uniform 。
rowLabels : list
数组的可选行标签。该数组中的索引与数据数组中的行索引相对应。如果该列表的长度小于行数,则并非所有行都会获得标签。
selectedBar : point
该系列中被选中的柱形。
所选条形的位置以该系列数据数组中的行和列来指定。
每次只能选中一个柱状图。
要清除该系列中的选择,请将位置设置为invalidSelectionPosition 。
如果将该系列添加到图表中,图表可以根据用户交互或当选择失效时调整选择。在另一个已添加的系列上选择一个条形也会清除该系列的选择。
从该系列中删除行或在选中条形所在行之前插入行,都会调整选中状态,以确保该条形保持选中。
另请参阅 GraphsItem3D.clearSelection()。
singleHighlightColor : color
该系列的单件突出显示颜色。
另请参阅 colorStyle 和GraphsTheme.singleHighlightColor 。
singleHighlightGradient : Gradient
该系列中单件商品的渐变高光效果。
另请参阅 colorStyle 和GraphsTheme.singleHighlightGradient 。
type : Abstract3DSeries.SeriesType [read-only]
序列的类型。QAbstract3DSeries::SeriesType 中的一个值。
userDefinedMesh : string
当使用mesh 时,用于对象的用户自定义网格的文件名为Abstract3DSeries.Mesh.UserDefined 。
注意:该文件 必须采用QtQuick3D 网格格式。请使用balsam 转换工具,将其他 3D 模型格式转换为网格。
visible : bool
该系列的可见性。如果false ,则不会渲染该系列。
Signal 文档
baseColorChanged(color color)
当baseColor 变为color 时,会触发此信号。
注意: 相应的处理程序 是onBaseColorChanged 。
baseGradientChanged(Gradient gradient)
当baseGradient 变为gradient 时,会触发此信号。
注意: 相应的处理程序 是onBaseGradientChanged 。
colorStyleChanged(GraphsTheme.ColorStyle style)
当colorStyle 变为style 时,会触发此信号。
注意: 相应的处理程序 是onColorStyleChanged 。
columnLabelsChanged()
当列标签发生变化时,会触发此信号。
注意: 相应的处理程序 为onColumnLabelsChanged 。
dataArrayChanged(BarDataArray array)
当dataArray 变为array 时,会触发此信号。
注意: 相应的处理程序 是onDataArrayChanged 。
dataProxyChanged(BarDataProxy proxy)
当dataProxy 变为proxy 时,会触发此信号。
注意: 相应的处理程序 是onDataProxyChanged 。
itemLabelChanged(string label)
当itemLabel 变更为label 时,会触发此信号。
注意: 对应的处理程序 是onItemLabelChanged 。
itemLabelFormatChanged(string format)
当itemLabelFormat 变为format 时,会触发此信号。
注意: 对应的处理程序 是onItemLabelFormatChanged 。
itemLabelVisibilityChanged(bool visible)
当 itemLabelVisibility 变为visible 时,会触发此信号。
注意: 相应的处理程序 为onItemLabelVisibilityChanged 。
[since 6.10] lightingModeChanged(Abstract3DSeries.LightingMode lightingMode)
当lightingMode 变为lightingMode 时,会触发此信号。
注意: 相应的处理程序 是onLightingModeChanged 。
该信号在 Qt 6.10 中引入。
meshAngleChanged(real angle)
当meshAngle 变为angle 时,会触发此信号。
注意: 对应的处理程序 是onMeshAngleChanged 。
meshChanged(Abstract3DSeries.Mesh mesh)
当mesh 变为mesh 时,会触发此信号。
注意: 相应的处理程序 是onMeshChanged 。
meshRotationChanged(quaternion rotation)
当meshRotation 变为rotation 时,会触发此信号。
注意: 相应的处理程序 是onMeshRotationChanged 。
meshSmoothChanged(bool enabled)
当meshSmooth 变为enabled 时,会触发此信号。
注意: 相应的处理程序 是onMeshSmoothChanged 。
multiHighlightColorChanged(color color)
当multiHighlightColor 变为color 时,会触发此信号。
注意: 对应的处理程序 为onMultiHighlightColorChanged 。
multiHighlightGradientChanged(Gradient gradient)
当multiHighlightGradient 变为gradient 时,会触发此信号。
注意: 对应的处理程序 是onMultiHighlightGradientChanged 。
nameChanged(string name)
当name 变为name 时,会触发此信号。
注意: 相应的处理程序 为onNameChanged 。
rowColorsChanged(list<color> rowcolors)
当rowColors 变为rowcolors 时,会触发此信号。
注意: 相应的处理程序 是onRowColorsChanged 。
rowLabelsChanged()
当行标签发生变化时,会触发此信号。
注意: 相应的处理程序 为onRowLabelsChanged 。
selectedBarChanged(point position)
当selectedBar 变为position 时,会触发此信号。
注意: 相应的处理程序 是onSelectedBarChanged 。
singleHighlightColorChanged(color color)
当singleHighlightColor 变为color 时,会触发此信号。
注意: 相应的处理程序 为onSingleHighlightColorChanged 。
singleHighlightGradientChanged(Gradient gradient)
当singleHighlightGradient 变为gradient 时,会触发此信号。
注意: 对应的处理程序 是onSingleHighlightGradientChanged 。
userDefinedMeshChanged(string fileName)
当userDefinedMesh 变为fileName 时,会触发此信号。
注意: 对应的处理程序 是onUserDefinedMeshChanged 。
visibilityChanged(bool visible)
当该系列的状态变为“visible ”时,会触发此信号。
注意: 相应的处理程序 为onVisibilityChanged 。
方法文档
void setMeshAxisAndAngle(vector3d axis, real angle)
一个便捷函数,用于根据axis 和angle 生成网格旋转四元数。
另请参阅 meshRotation 。
© 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.