# Axes and scales
URL: /diagrammatic/docs/axes-and-scales

Opt-in value axes, explicit tick ladders, log scales, target lines, and guides.

> For AI agents: a documentation index is available at [llms.txt](/llms.txt). Use `.md` for canonical markdown pages; `.mdx` is kept as a backwards-compatible alias on supported URL paths.

A chart with no value axis is a legitimate default here. Ticks are opt-in through `yTicks` and `xTicks`, which take either a count or an explicit ladder.

| Value             | Result                                                             |
| ----------------- | ------------------------------------------------------------------ |
| unset             | No value axis                                                      |
| `4`               | Four intervals on the 1, 2, 5 ladder inside the chart's own domain |
| `[{ at, label }]` | Exactly those ticks; they widen the domain to include themselves   |

Labels come from the chart's `format`, and the widest printed label sizes the gutter, so a six-digit axis is not cut and a two-digit one does not waste the plot.

- title

  Cumulative stars

- labels

  - M1
  - M2
  - M3
  - M4
  - M5
  - M6
  - M7
  - M8
  - M9
  - M10
  - M11
  - M12

- data

  - 180
  - 420
  - 760
  - 1500
  - 2600
  - 4100
  - 6900
  - 9800
  - 14200
  - 21500
  - 30100
  - 41800

- yScale

  log

- yTicks

  3

fig. 01 · yScale="log" with a count of ticks, which counts in decades

- title

  Weekly deploys

- items

  - - label

      W1

    - value

      14

  - - label

      W2

    - value

      19

  - - label

      W3

    - value

      11

  - - label

      W4

    - value

      23

  - - label

      W5

    - value

      27

  - - label

      W6

    - value

      21

  - - label

      W7

    - value

      31

  - - label

      W8

    - value

      29

- yTicks

  - - at

      0

    - label

      0

  - - at

      10

    - label

      10

  - - at

      20

    - label

      20

  - - at

      30

    - label

      30

- target

  - at

    25

  - label

    goal

- highlight

  max

fig. 02 · An explicit tick ladder and a target line

- title

  p95 latency, ms

- labels

  - 00:00
  - 02:00
  - 04:00
  - 06:00
  - 08:00
  - 10:00
  - 12:00
  - 14:00
  - 16:00
  - 18:00
  - 20:00
  - 22:00

- data

  - 212
  - 220
  - 231
  - 226
  - 240
  - 238
  - 251
  - 296
  - 318
  - 284
  - 262
  - 248

- yTicks

  4

- guides

  - - at

      300

    - label

      SLO

  - - at

      7

    - axis

      x

    - label

      deploy

fig. 03 · guides on both axes: a threshold in data units and a release in index units

## Log scales

`Line`, `Area`, `Scatter`, `ConnectedScatter`, `Histogram`, `Hexbin`, `Contour`, `Column`, and `Bar` take `xScale` or `yScale` of `"log"`. A tick count on log paper counts decades, because a linear ladder on log paper lands on nothing.

```
<Line labels={months} data={stars} yScale="log" yTicks={3} format={formatCompact} />
```

## Targets and guides

`Column` and `Bar` take a `target` reference line with an optional label. Most value-axis forms take `guides`, a list of `{ at, axis, label }` lines for thresholds such as an SLO or a release. A guide sits on the value axis by default, in data units; `axis: "x"` puts it on the category axis, in index units or in `xs` units when the chart has them. A guide widens the domain to include itself.

```
<Column items={deploys} target={{ at: 25, label: "goal" }} highlight="max" />
<Line
  labels={hours}
  data={p95}
  guides={[
    { at: 300, label: "SLO" },
    { at: 7, axis: "x", label: "deploy" },
  ]}
/>
```

## The same numbers elsewhere

The tick math is exported: `niceTicks`, `decadeTicks`, `resolveTicks`, `niceStep`, and `upperBound`. Use them when a table header or a legend needs the same numbers the chart prints.