---
id: "packages/active-charts/all-exports/datum-paint"
title: "Datum paint"
description: "DatumFill, DatumPaint, DatumPaintContext, DatumPaintResolver: generated from the source of active-charts."
url: "/packages/active-charts/all-exports/datum-paint"
locale: "en"
revision: "g0mvjxwj5c-88bdbe1c:datum-paint"
---

# Datum paint

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

## Types

**DatumFill**

```ts
interface DatumFill {
  readonly fill?: string;
}
```

Paint of a mark that is only a fill (a bar, a slice).

**DatumPaint**

```ts
interface DatumPaint extends DatumFill {
  readonly stroke?: string;
}
```

Paint of a point mark, which has a fill and an edge.

**DatumPaintContext**

```ts
interface DatumPaintContext<TDatum = ChartDatum> {
  readonly datum: TDatum;
  readonly index: number;
  readonly value: number;
  readonly role?: ChartValueRole;
  readonly seriesId: string;
  readonly seriesName: string;
}
```

What a resolver knows about the item it paints.

**DatumPaintResolver**

```ts
type DatumPaintResolver<
  TPaint extends DatumFill = DatumFill,
  TDatum = ChartDatum,
> = (context: DatumPaintContext<TDatum>) => TPaint | undefined;
```

A per-datum paint resolver: called for each item, returns the item's own
paint or `undefined` for the series paint. It should be pure and cheap;
the chart calls it once per item and data, and reads the cached result
wherever the item's paint is shown. A result that is not a colour, or a
resolver that throws, falls back to the series paint and is reported
through the chart's diagnostics.
