Taucharts uses formatters to convert raw data values into human-readable strings on axes and in tooltips. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/TargetProcess/tauCharts/llms.txt
Use this file to discover all available pages before exploring further.
tickFormat API lets you retrieve any built-in formatter by name or register your own, then reference it anywhere a format name is accepted.
API reference
Retrieve a registered formatter function by name.If the name matches a built-in or previously registered format, the corresponding function is returned. If no match is found, an identity formatter is returned instead.
Register a new named formatter.Once registered, the name can be used anywhere
tickFormat accepts a string — in guide, defaultFormats, or plugin formatter maps.Built-in format names
The following names are available out of the box, sourced fromformatter-registry.ts:
| Name | Output example | Notes |
|---|---|---|
x-num-auto | 1.23k, 0.045 | Automatic number formatting using d3; removes trailing zeros |
x-time-auto | 14-Jan-2024 | Resolved at runtime to day or day-utc based on utcTime setting |
percent | 42.5% | Multiplies by 100 and appends % |
day | 14-Jan-2024 | Local time, d3 %d-%b-%Y |
day-utc | 14-Jan-2024 | UTC, d3 %d-%b-%Y |
day-short | 14-Jan | Local time, d3 %d-%b |
day-short-utc | 14-Jan | UTC, d3 %d-%b |
week | 14-Jan-2024 | Local time, week start |
week-utc | 14-Jan-2024 | UTC, week start |
week-short | 14-Jan | Local time, short week |
week-short-utc | 14-Jan | UTC, short week |
month | January / January, 2024 | Year shown only for January |
month-utc | January / January, 2024 | UTC variant |
month-short | Jan / Jan '24 | Year shown only for January |
month-short-utc | Jan / Jan '24 | UTC variant |
month-year | January, 2024 | Always includes year |
month-year-utc | January, 2024 | UTC variant |
quarter | Q1 2024 | |
quarter-utc | Q1 2024 | UTC variant |
year | 2024 | |
year-utc | 2024 | UTC variant |
Any d3 format string (e.g.
".2f" or "%Y-%m-%d") that is not a registered name is passed directly to d3.format or d3.timeFormat, so you can use d3 specifiers without registering them first.Using a formatter in guide
Pass a format name or an inline function totickFormat on the x or y axis guide:
Registering a custom formatter
CalltickFormat.add once before creating charts that use the new name:
Using formatters in plugins
Thetooltip and crosshair plugins accept a formatters map keyed by field name. Each entry can be a function or an object with label and format:
defaultFormats setting
ThedefaultFormats entry in ChartSettings maps dimension types to format names. The built-in defaults are: