Skip to content

Documentation / @ripl/charts / createTimeAxisScale

Function: createTimeAxisScale() ​

createTimeAxisScale(options, domain, range): Scale<Date, number>

Defined in: charts/src/core/scales.ts:61

Builds a time-axis Scale from resolved axis options over a millisecond extent and pixel range. An explicit numeric min/max (epoch milliseconds) overrides the corresponding end of the data extent. Ticks are calendar-aligned Date values from the core time scale.

Parameters ​

ParameterTypeDescription
optionsChartAxisItemOptionsThe resolved axis options (min/max in epoch milliseconds where set).
domainnumber[]The data extent [min, max] in epoch milliseconds.
rangenumber[]The pixel range [start, end] the scale maps onto.

Returns ​

Scale<Date, number>

A scale mapping Date values to pixels.