BarCategoryAxis QML Type
向图表的坐标轴添加类别。更多...
| Import Statement: | import QtCharts 2.12 |
| In C++: | QBarCategoryAxis |
| Inherits: | |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- categories : list<string>
- count : int
- max : string
- min : string
信号
- rangeChanged(string min, string max)
方法
- void clear()
详细说明
BarCategoryAxis 类型可配置为显示带有刻度、网格线和阴影的坐标轴线。类别会绘制在刻度之间。该类型也可与折线系列配合使用。
以下 QML 代码片段演示了如何使用 BarCategoryAxis:
ChartView {
BarCategoryAxis {
id: categoryAxis
categories: ["Jan", "Feb", "Mar", "Apr", "May", "Jun" ]
}
// Add a few series...
}属性文档
categories : list<string>
坐标轴的类别。
count : int [read-only]
轴的类别数量。
max : string
坐标轴上的最大值。
min : string
轴上的最小值。
信号文档
rangeChanged(string min, string max)
当轴的min 或max 值发生变化时,会触发此信号。
相应的信号处理程序是onRangeChanged 。
注意: 相应的处理程序 是onRangeChanged 。
方法文档
void clear()
删除所有类别。将坐标轴范围的最大值和最小值设置为 QString::null。
© 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.