---
id: "packages/active-charts/all-exports/use-chart-axis-formatters"
title: "Use chart axis formatters"
description: "createChartAxisFormatters, useChartAxisFormatters, ChartAxisFormatters: generated from the source of active-charts."
url: "/packages/active-charts/all-exports/use-chart-axis-formatters"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:use-chart-axis-formatters"
---

# Use chart axis formatters

Exported by `@workspace/active-charts`. Generated from the package source; part of [the index of every export](/packages/active-charts/all-exports).

## Functions, hooks and constants

**createChartAxisFormatters**: `(presentation: ChartPresentation) => ChartAxisFormatters`

**Internal.** Shareable implementation, callable without React context.

**useChartAxisFormatters**: `(presentation?: ChartPresentation) => ChartAxisFormatters`

The axis-formatter factories for this chart tree's presentation.

Resolution: explicit argument → `ChartDefaults.locale` (the app shell) →
a configuration error; there is no `'en'` fallback (active-format D14). The
result is memoised on the presentation identity, so a presentation object
should be referentially stable, as with the `locale` prop.

Returns an object with:

| Prop | Type | Required | Description |
| --- | --- | --- | --- |
| `number` | `(preset?: NumberFormat) => AxisValueFormatter` | yes | Number axis with a semantic preset (default `'decimal'`). |
| `currency` | `(currency: string, options?: CurrencyFormatOptions) => AxisValueFormatter` | yes | Currency axis. The currency identity comes from the data or the caller's domain invariant: required, never derived from the language. |
| `fractionAsPercent` | `(preset?: PercentPreset) => AxisValueFormatter` | yes | Percentage axis for 0-1 data (0.125 means 12.5%). |
| `percentagePoints` | `(preset?: PercentPreset) => AxisValueFormatter` | yes | Percentage axis for 0-100 data (12.5 means 12.5%). |
| `date` | `(semantic: TemporalSemantic, preset?: DatePreset) => AxisValueFormatter` | yes | Date axis with a date preset (default `'day-month'`). The semantic is required and equals the axis's `temporalSemantic`: a calendar date stays its own day, an instant follows the presentation's zone. A calendar date only accepts a calendar-day preset. |

## Types

**ChartAxisFormatters**

```ts
interface ChartAxisFormatters {
  number: (preset?: NumberFormat) => AxisValueFormatter;
  currency: (
    currency: string,
    options?: CurrencyFormatOptions,
  ) => AxisValueFormatter;
  fractionAsPercent: (preset?: PercentPreset) => AxisValueFormatter;
  percentagePoints: (preset?: PercentPreset) => AxisValueFormatter;
  date: (semantic: TemporalSemantic, preset?: DatePreset) => AxisValueFormatter;
}
```

Factories for the common axis-label forms. Each factory returns a closure
that passes non-numeric (or non-date) values through as `String(value)`.
