Interface: Locale
A chart's resolved locale (fullLayout._locale): the translation function and the formatters every label, tick and hover text goes through.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
format | readonly | Readonly<LocaleFormat> | Formats in effect, with decimal / thousands from layout.separators. |
name | readonly | string | Normalized config.locale. |
separators | readonly | string | Decimal then thousands separator (layout.separators after defaults). |
Methods
_()
ts
_(text): string;Translate a UI string (Plotly's Lib._); strings without a translation come back as they are.
Parameters
| Parameter | Type |
|---|---|
text | string |
Returns
string
numberFormat()
ts
numberFormat(specifier): ((n) => string) | null;A d3-format formatter in this locale, or null for an invalid specifier. Cached.
Parameters
| Parameter | Type |
|---|---|
specifier | string |
Returns
((n) => string) | null
timeFormat()
ts
timeFormat(specifier): (d) => string;A UTC d3-time-format formatter in this locale. Cached.
Parameters
| Parameter | Type |
|---|---|
specifier | string |
Returns
(d) => string