Skip to main content
100%

Localized Time Axis II

✓ Published0🌍 Public
Mmbostock
Last edited Dec 5, 2016
Created on Dec 5, 2016

A year-long time axis renders with Russian-language month, day, and time labels. The example uses `d3.timeFormatLocale` to define a custom locale and `d3.timeFormat`-based functions for millisecond, second, minute, hour, day, week, month, and year granularities. A single bottom axis, drawn with `d3.axisBottom` and `d3.scaleTime`, applies a multi-scale format via a `multiFormat` function that selects the appropriate label based on the date’s position within the year. No data is plotted; the SVG canvas shows only the axis.

AI-generated description

This example uses d3.timeFormatLocale to define a custom localized multi-scale time format for use with d3-axis. A simpler approach is to use d3.timeFormatDefaultLocale.

gpl-3.0 Licensed

Similar vizzes