DateTimeAxis QML Type
向图表坐标轴添加 DateTime 项目。更多
| Import Statement: | import QtGraphs |
| In C++: | QDateTimeAxis |
| Inherits: |
- 所有成员的列表,包括继承成员
- DateTimeAxis 是Qt Graphs QML Types for 2D 的一部分。
属性
- labelFormat : string
- max : real
- min : real
- subTickCount : int
- tickInterval : real
信号
- labelFormatChanged(string format)
- maxChanged(DateTime max)
- minChanged(DateTime min)
- rangeChanged(real min, real max)
- subTickCountChanged(int subTickCount)
- tickIntervalChanged(real tickInterval)
详细说明
日期时间轴可用于显示带有刻度线和网格线的日期时间表示法。轴上的 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 或更低,坐标轴将自动计算适当的刻度线数量。默认值为 0。
信号文档
labelFormatChanged(string format) |
当format 的轴标签发生变化时,将发出该信号。
注: 相应的处理程序是onLabelFormatChanged 。
maxChanged(DateTime max) |
当max 指定的坐标轴最大值发生变化时,将发出此信号。
注: 相应的处理程序是onMaxChanged 。
minChanged(DateTime min) |
当min 指定的轴的最小值发生变化时,将发出该信号。
注: 相应的处理程序是onMinChanged 。
subTickCountChanged(int subTickCount) |
当由subTickCount 指定的坐标轴上的子点数发生变化时,将发出此信号。
注: 相应的处理程序是onSubTickCountChanged 。
tickIntervalChanged(real tickInterval) |
当tickInterval 指定的刻度间隔值发生变化时,将发出该信号。
注: 相应的处理程序是onTickIntervalChanged 。
© 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.