time.tickFormat([count[, specifier]])
time.tickFormat([interval[, specifier]])
Returns a time format function suitable for displaying tick values. The specified count or interval is currently ignored, but is accepted for consistency with other scales such as continuous.tickFormat. If a format specifier is specified, this method is equivalent to format. If specifier is not specified, the default time format is returned. The default multi-scale time format chooses a human-readable representation based on the specified date as follows:
-
%Y
- for year boundaries, such as2011
. -
%B
- for month boundaries, such asFebruary
. -
%b %d
- for week boundaries, such asFeb 06
. -
%a %d
- for day boundaries, such asMon 07
. -
%I %p
- for hour boundaries, such as01 AM
. -
%I:%M
- for minute boundaries, such as01:23
. -
:%S
- for second boundaries, such as:45
. -
.%L
- milliseconds for all other times, such as.012
.
Although somewhat unusual, this default behavior has the benefit of providing both local and global context: for example, formatting a sequence of ticks as [11 PM, Mon 07, 01 AM] reveals information about hours, dates, and day simultaneously, rather than just the hours [11 PM, 12 AM, 01 AM]. See d3-time-format if you’d like to roll your own conditional time format.
Please login to continue.