BarCategoryAxis QML Type

为图表的坐标轴添加类别。更多

Import Statement: import QtCharts 2.9
In C++: QBarCategoryAxis
Inherits:

AbstractAxis

属性

信号

方法

详细说明

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)

minmax 轴的值发生变化时,将发出该信号。

相应的信号处理程序是onRangeChanged

注: 相应的处理程序是onRangeChanged


方法文档

void clear()

删除所有类别。将轴范围的最大值和最小值设置为 QString::null。


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