> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To set up Hatchmark for a user, follow https://hatchmark.dev/docs/get-started/agent-setup.md. Inside a Hatchmark project, prefer `hatchmark docs`: it prints the docs of the installed version.

# Small multiples

> facet repeats a line, area or bar chart once per value of a column, as a grid of small panels on one shared scale, so the panels compare at a glance.

```yaml theme={null}
type: line
title: The United States still brings most of the growth
metrics: [revenue]
grain: month
facet: country
```

[Live preview of the facet component](https://components.hatchmark.dev/components/facet/?embed\&theme=light)

The preview above is the live component gallery. [Open it full size](https://components.hatchmark.dev/#/facet) to switch between desktop and phone widths.

## Options

| Field | Type | Description |
| - | - | - |
| `facet` | column | On `line`, `area` and `bar`: one panel per value of the column. |

Every other field is the [line, area](/docs/components/line.md) or [bar](/docs/components/bar.md) block's.

## Examples

### Several series per panel

With `split` or several `metrics`, every panel draws the same series in the same colours, with one
key above the grid.

```yaml theme={null}
type: area
title: Organic search carries a larger share in EMEA
metrics: [revenue]
grain: month
split: channel
stack: percent
facet: region
```

## Behavior

* Panels are ordered largest first by the first metric over the period. A null value gets its own
  panel, `(empty)`.
* Up to 9 panels. Past that, the 8 largest show and the rest share one "Other (n more)" panel,
  recomputed from its rows, so a rate in Other is the real rate.
* A distinct count, a median or a non-additive SQL metric gets no Other panel; the card says how
  many values were left out.
* Every panel shares the axis and the value scale, so equal heights mean equal values. `sort` and
  `limit` apply to the whole chart.
* Hovering one panel moves every panel to that period.
* On a line, area or vertical time-bar chart, [zooming](/docs/components/line.md#behavior) in one panel zooms all
  panels to the same buckets. They still share one value scale.
* The grid fits the card: up to 4 columns on wide cards, 2 on phones.

## Checks

| Code | When |
| - | - |
| HM3007 | `facet` names the `split` or `by` column, or the chart also sets `grains` or `target`. |

One bar of shares (a bar with `split` and neither `by` nor `grain`) can't be faceted.
`hatchmark explain <code>` explains a check and how to fix it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.