DateTimeAxis QML Type

向图表坐标轴添加 DateTime 项目。更多

Import Statement: import QtGraphs
In C++: QDateTimeAxis
Inherits:

AbstractAxis

属性

信号

详细说明

日期时间轴可用于显示带有刻度线和网格线的日期时间表示法。轴上的 DateTime 项目显示在刻度线的位置。

以下示例代码说明了如何使用 DateTimeAxis 类型:

GraphsView {
    axisX: DateTimeAxis {
        min: new Date(2000,1,1)
        max: new Date(1970,1,1)
    }
    LineSeries {
        // Add a few XYPoint data...
    }
}

属性文档

labelFormat : string

坐标轴上 DateTime 标签的格式 format 属性用于表示 DateTime 对象的可视化表示形式,单位为天、月或年。默认值为 dd-MMMM-yy。


max : real

坐标轴上的最大值。

该值可以低于或高于最小值。DateTime 内部存储为 UTC。默认值为 new Date(1980,1,1)


min : real

坐标轴上的最小值。

该值可以低于或高于最大值。DateTime 在内部以 UTC 保存。默认值为 new Date(1970,1,1)


subTickCount : int

坐标轴上的小标点数。这表示在图形的主要线条之间绘制多少个子线。不会为子刻线绘制标签。默认值为 0。


tickInterval : real

动态放置的刻度线和标签之间的间隔。默认值为 0,即根据最小和最大范围自动计算间隔。


信号文档

labelFormatChanged(string format)

format 轴标签发生变化时,将发出该信号。

注: 相应的处理程序是onLabelFormatChanged


maxChanged(DateTime max)

当由max 指定的坐标轴最大值发生变化时,将发出此信号。

注: 相应的处理程序是onMaxChanged


minChanged(DateTime min)

min 指定的坐标轴最小值发生变化时,将发出该信号。

注: 相应的处理程序是onMinChanged


rangeChanged(real min, real max)

minmax 指定的轴的最小值或最大值发生变化时,将发出此信号。

注: 相应的处理程序是onRangeChanged


subTickCountChanged(int subTickCount)

当由subTickCount 指定的坐标轴上的子点数发生变化时,将发出此信号。

注: 相应的处理程序是onSubTickCountChanged


tickIntervalChanged(real tickInterval)

tickInterval 指定的刻度间隔值发生变化时,将发出该信号。

注: 相应的处理程序是onTickIntervalChanged


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