DateTimeAxis QML Type
Adds DateTime items to a graph's axis. More...
| Import Statement: | import QtGraphs |
| In C++: | QDateTimeAxis |
| Inherits: |
- List of all members, including inherited members
- Deprecated members
- DateTimeAxis is part of Qt Graphs QML Types for 2D.
Properties
- labelFormat : string
- max : real
- min : real
- pan : real
(since 6.11) - subTickCount : int
- tickCount : real
(since 6.12) - timeZone : QTimeZone
(since 6.11) - visualMax : real
(since 6.11) - visualMin : real
(since 6.11) - zoom : real
(since 6.11)
Signals
- labelFormatChanged(string format)
- maxChanged(DateTime max)
- minChanged(DateTime min)
- rangeChanged(real min, real max)
- subTickCountChanged(int subTickCount)
- tickCountChanged(real count)
(since 6.12) - timeZoneChanged()
(since 6.11) - zoomChanged()
(since 6.11)
Methods
- QTimeZone timeZone(string zoneId)
(since 6.11) - string timeZoneAsString()
(since 6.11)
Detailed Description
A DateTime Axis can be used to display DateTime representations with tick marks and grid lines. The DateTime items on the axis are displayed at the position of the ticks.
The following example code illustrates how to use the DateTimeAxis type:
GraphsView {
axisX: DateTimeAxis {
min: new Date(2000,1,1)
max: new Date(1970,1,1)
}
LineSeries {
// Add a few XYPoint data...
}
}Property Documentation
labelFormat : string
The format of the DateTime labels on the axis The format property allows to signify the visual representation of the DateTime object, in days, months, and years. The default value is dd-MMMM-yy.
max : real
The maximum value on the axis.
This value can be lower or higher than the minimum. The DateTime is stored as UTC internally. The default value is new Date(1980,1,1)
min : real
The minimum value on the axis.
This value can be lower or higher than the maximum. The DateTime is stored as UTC internally. The default value is new Date(1970,1,1)
pan : real [since 6.11]
The pan value of the axis.
The pan value moves the center of the axis without affecting intervals of grid and labels. The default value is 0.
This property was introduced in Qt 6.11.
subTickCount : int
The number of subticks on the axis. This indicates how many subticks are drawn between major lines on the graph. Labels are not drawn for subticks. The default value is 0.
tickCount : real [since 6.12]
The amount of major ticks placed on an axis. If the value is 0 or lower, the axis automatically calculates the appropriate amount of ticks. The default value is 0.
This property was introduced in Qt 6.12.
timeZone : QTimeZone [since 6.11]
The time zone that will be used to display labels of the axis. The accepted values are based on IANA time zone IDs. The default time zone is UTC.
This property was introduced in Qt 6.11.
visualMax : real [read-only, since 6.11]
The visual maximum value of the axis.
This property holds a a visual maximum axis value when axis has been panned or zoomed. The default value is max
This property was introduced in Qt 6.11.
visualMin : real [read-only, since 6.11]
The visual minimum value of the axis.
This property holds a a visual minimum axis value when axis has been panned or zoomed. The default value is min
This property was introduced in Qt 6.11.
zoom : real [since 6.11]
The zoom value of the axis. The zoom value enlarges or shrinks the axis and thus the graph without affecting intervals of grid and labels. The default value is 1.
This property was introduced in Qt 6.11.
Signal Documentation
labelFormatChanged(string format)
This signal is emitted when the format of axis labels changes.
Note: The corresponding handler is onLabelFormatChanged.
maxChanged(DateTime max)
This signal is emitted when the maximum value of the axis, specified by max, changes.
Note: The corresponding handler is onMaxChanged.
minChanged(DateTime min)
This signal is emitted when the minimum value of the axis, specified by min, changes.
Note: The corresponding handler is onMinChanged.
rangeChanged(real min, real max)
This signal is emitted when the minimum or maximum value of the axis, specified by min and max, changes.
Note: The corresponding handler is onRangeChanged.
subTickCountChanged(int subTickCount)
This signal is emitted when the number of subticks on the axis, specified by subTickCount, changes.
Note: The corresponding handler is onSubTickCountChanged.
[since 6.12] tickCountChanged(real count)
This signal is emitted when the tickCount of the axis, specified by count, changes.
Note: The corresponding handler is onTickCountChanged.
This signal was introduced in Qt 6.12.
[since 6.11] timeZoneChanged()
This signal is emitted when the time zone is changed. It represents a string value for the IANA time zone ID that was set.
Note: The corresponding handler is onTimeZoneChanged.
This signal was introduced in Qt 6.11.
[since 6.11] zoomChanged()
This signal is emmited when the zoom value changes.
Note: The corresponding handler is onZoomChanged.
This signal was introduced in Qt 6.11.
Method Documentation
[since 6.11] QTimeZone timeZone(string zoneId)
Returns the QTimeZone corresponding to IANA based zoneId.
Note: This is the converter method for setting the timeZone.
This method was introduced in Qt 6.11.
See also QDateTimeAxis::timeZone and timeZoneAsString.
[since 6.11] string timeZoneAsString()
Returns the QDateTimeAxis::timeZone's IANA based zone ID as a string.
This method was introduced in Qt 6.11.
See also timeZone.
© 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.