# Map of Berlin by district, one number per district

A chartlink template (choropleth). Page: https://chartlink.app/maps/berlin/districts · Example image: https://chartlink.app/a/ast_QfHPUEW7bwDNDkUxauEle.png?v=3&w=1200 · Template id: `ast_QfHPUEW7bwDNDkUxauEle`

Also answers: Berlin map by district · Berlin Bezirke Karte · map of Berlin's 12 boroughs · Berlin districts choropleth · Karte Berlin nach Bezirken

## About

Data: one row per district with its code (001 for Mitte, 003 for Pankow) or its name, and a number. A district with no row stays grey. Codes are the district keys 001–012 (Mitte 001, Friedrichshain-Kreuzberg 002, Pankow 003, Charlottenburg-Wilmersdorf 004, Spandau 005, Steglitz-Zehlendorf 006, Tempelhof-Schöneberg 007, Neukölln 008, Treptow-Köpenick 009, Marzahn-Hellersdorf 010, Lichtenberg 011, Reinickendorf 012). Same design as the other city maps, so they sit together.

A choropleth map of the regions of the "berlin-districts" geography, each region filled by one number from your data (the "population" column).

A sequential colour scale from pale blue for the smallest values to deep navy blue for the largest; pinned to 250000 to 450000, so values beyond the ends take the end colour and the colour bar says ≤ and ≥; a gradient colour bar below the map, with its labels underneath; values formatted in compact form (1.2k, 3.4M), 1 decimal; on a white canvas (#ffffff) with near-black text — a light theme; 0.6-unit hairline outlines between regions.

The title and description are left-aligned above the chart. Font: Inter (the default); a source line with a link sits at the bottom, with the chartlink badge in the corner.

Data: 2 columns — district (string, "District (code or name)"), population (number, "Population, 31 December 2024") — and 12 rows in the example "Population of Berlin's districts, 2024". Regions are named by ISO 3166-2 region codes or region names; a region with no row stays unfilled in grey, and an unknown code fails loudly with the nearest matches. Your data keeps the same column ids and every other setting comes from the template; an agent can change any of them.

Other looks of this template — dark (on a dark canvas): ast_nvk0UZ9Ijj6D4DBfaidNG; buckets (with the values in classes and a swatch legend): ast_qSUlzyayjA5iYfi8man24; editorial (in the editorial house style — serif type on paper, a green ramp): ast_8lVnkanjJgoiTh2348uQw; categories (with a text category per region and a swatch legend): ast_x0WxyXXpuP1goagHeO5HV; buckets-dark (with the values in classes and a swatch legend, on a dark canvas): ast_92pK0upNnSAwDkDrEYO3C; surroundings (with the land around the place drawn in grey): ast_7NwIyDCp0JsAedjWwHc38; categories-dark (with a text category per region and a swatch legend, on a dark canvas): ast_hDkcAZmxOkTZJ3sx24z0n; buckets-editorial (with the values in classes and a swatch legend, in the editorial house style — serif type on paper, a green ramp): ast_mpKrOb1JG6bsHju9FeqdS; dark-surroundings (on a dark canvas, with the land around the place drawn in grey): ast_QXYxamFj0oeb5eea1UcyH; buckets-surroundings (with the values in classes and a swatch legend, with the land around the place drawn in grey): ast_Q6JuYHZ3DPLKfk7p0Ernj; categories-editorial (with a text category per region and a swatch legend, in the editorial house style — serif type on paper, a green ramp): ast_xsGT18D2QjdkYF1c9DuhR; editorial-surroundings (in the editorial house style — serif type on paper, a green ramp, with the land around the place drawn in grey): ast_nqJudK2dkvzdoy7TULAkQ; categories-surroundings (with a text category per region and a swatch legend, with the land around the place drawn in grey): ast_XoJiDIqBbszG4RYIICrQm; buckets-dark-surroundings (with the values in classes and a swatch legend, on a dark canvas, with the land around the place drawn in grey): ast_DWxaQ1trbENPa7Ivcfev7; categories-dark-surroundings (with a text category per region and a swatch legend, on a dark canvas, with the land around the place drawn in grey): ast_EWahvorf5dMAdn9rwwrBk; buckets-editorial-surroundings (with the values in classes and a swatch legend, in the editorial house style — serif type on paper, a green ramp, with the land around the place drawn in grey): ast_nRgbF1arYSoqNkpdZj2gf; categories-editorial-surroundings (with a text category per region and a swatch legend, in the editorial house style — serif type on paper, a green ramp, with the land around the place drawn in grey): ast_gT8m8m1F7knHFXGCAj2pN. On the page, switch with the toggles; an agent passes that id as the template instead.

## Looks

Available: gradient light, gradient dark, buckets light, gradient editorial, categories light, buckets dark, gradient light with surroundings, categories dark, buckets editorial, gradient dark with surroundings, buckets light with surroundings, categories editorial, gradient editorial with surroundings, categories light with surroundings, buckets dark with surroundings, categories dark with surroundings, buckets editorial with surroundings, categories editorial with surroundings. Pick one with the `theme`, `dataType` and `surroundings` knobs.

## Knobs (the template's settings)

- `theme`: "light" | "dark" | "editorial" (default "light") — light or dark: the whole colour bundle — canvas, text, outlines, key (editorial: the house style, where a template offers it — the contract's looks say)
- `dataType`: "gradient" | "buckets" | "categories" (default "gradient") — How the value column is encoded. "gradient": a number per region on a continuous scale. "buckets": numbers sorted into classes with a swatch key. "categories": a TEXT label per region, one colour each
- `surroundings`: boolean (default false) — true draws the land around the place in quiet grey — the neighbouring states or countries — and the water in blue, so the reader sees where it sits. The frame stays the same. With it, waterColor and landColor apply.
- `missing`: "hatch" | "plain" — How a region with no row is drawn: "hatch" (thin diagonal lines, the templates' default) or "plain" (a flat grey)
- `waterColor`: string — With surroundings: the colour of the water (the map area's ground). An error without surroundings: true
- `landColor`: string — With surroundings: the fill of the neighbouring land. An error without surroundings: true
- `backgroundColor`: string — Overrides the canvas colour after the theme; text and outline colours stay the theme's
- `border`: object — A frame around the whole graphic
- `title`: object
- `description`: object
- `source`: object — The source line at the bottom left
- `brand`: object — The byline at the bottom right — premium charts only; the free tier reads "Made with chartlink.app"
- `colormap`: "blues" | "greens" | "purples" | "oranges" | "reds" | "greys" | "yellow-green-blue" | "yellow-orange-red" | "viridis" | "magma" | "cividis" | "blue-red" | "red-blue" | "brown-teal" | "purple-green" | "orange-purple" — gradient and buckets: the colour ramp. One hue: blues (default), greens, purples, oranges, reds, greys. Several hues: yellow-green-blue, yellow-orange-red, viridis, magma, cividis. Diverging around zero, for signed data: blue-red, red-blue, brown-teal, purple-green, orange-purple. Details: blues (the default: one blue, light to dark); greens (one green, light to dark); purples (one purple, light to dark); oranges (one orange, light to dark); reds (one red, light to dark); greys (one grey, light to dark — for a muted map); yellow-green-blue (pale yellow through green to deep blue (ColorBrewer YlGnBu)); yellow-orange-red (pale yellow through orange to deep red (ColorBrewer YlOrRd) — heat); viridis (dark purple through teal to yellow — perceptually even, colour-blind safe); magma (black through magenta to pale yellow — perceptually even); cividis (blue to yellow — even and safe for every kind of colour blindness); blue-red (blue below zero, red above (the default diverging)); red-blue (red below zero, blue above); brown-teal (brown below, teal above (ColorBrewer BrBG) — dry against wet, loss against gain); purple-green (purple below, green above (ColorBrewer PRGn)); orange-purple (orange below, purple above (ColorBrewer PuOr))
- `direction`: "normal" | "reversed" — gradient and buckets: "reversed" runs the colormap the other way — dark for low values, or the arms of a diverging ramp swapped — when a high number is the bad one
- `range`: array — gradient (and equal-width buckets): pin the scale to [min, max]; values beyond clamp and the key says ≤ / ≥ — an outlier no longer pushes every other region to one end. Omit to fit the data
- `breaks`: array — buckets: the ascending cut points between classes; sets the class count
- `classes`: integer — buckets: how many quantile classes when breaks are not given (default 5)
- `categoryColors`: object — categories: a colour per label, e.g. {"Republican": "#dc2626"}
- `categoryOrder`: array — categories: the key's order; labels not listed follow in order of appearance

## Data

| column | role | type | about |
|---|---|---|---|
| `district` | region | string | The region, as a code the geography knows (see region) |
| `population` | value | number | The value per region: a number for gradient and buckets, a text label for categories |

## Region codes

Geography `berlin-districts`: ISO 3166-2 region codes or region names. The region's exact name or a listed alias also works; unknown codes fail with the closest matches.. A region with no row stays grey.
Examples: `001` (Mitte), `007` (Tempelhof-Schöneberg), `012` (Reinickendorf).
Every region with its aliases: https://chartlink.app/api/geographies/berlin-districts

## What each dataType expects

- **gradient**: value column number; knobs `colormap`, `direction`, `range`. A continuous colour scale fitted to your numbers; colormap names the ramp (blues by default; a diverging one pins its middle to zero), direction reverses it, range pins the ends so an outlier cannot stretch the scale.
- **buckets**: value column number; knobs `colormap`, `direction`, `breaks`, `classes`, `range`. Numbers sorted into classes with a swatch key: give breaks, or a class count (quantiles by default; with range, equal-width); colormap and direction as for gradient.
- **categories**: value column string; knobs `categoryColors`, `categoryOrder`. A label per region, one colour each, keyed in the order the labels first appear (or categoryOrder).

## With surroundings

With surroundings: true the water and the neighbouring land are drawn; these two knobs recolour them. Without it they are an error. Knobs: `waterColor`, `landColor`.

## Make one

Copy this shape, replace the rows with yours, and POST it (no account needed: `POST /api/signup` returns a key, shown once).

```
POST https://chartlink.app/api/assets
Authorization: Bearer <apiKey>
{
  "template": "ast_QfHPUEW7bwDNDkUxauEle",
  "knobs": {
    "theme": "light",
    "dataType": "gradient",
    "title": {
      "text": "Your title"
    },
    "description": {
      "text": "One sentence on what the map shows."
    },
    "source": {
      "text": "Where the numbers come from"
    }
  },
  "data": {
    "columns": [
      {
        "id": "district",
        "type": "string"
      },
      {
        "id": "population",
        "type": "number"
      }
    ],
    "rows": [
      [
        "001",
        397004
      ],
      [
        "002",
        292624
      ],
      [
        "003",
        427276
      ]
    ]
  },
  "publish": true
}
```

Dry run first if unsure of the codes: `POST https://chartlink.app/api/templates/map-berlin-districts/check` with {data, knobs} reports unmatched values with the closest real codes and creates nothing.

The create does this check itself: a region value that matches nothing comes back as a 400 listing it with the closest real codes, before anything is made. The template can be named by its id, its slug, or its page address (berlin/districts).

Over MCP (`https://chartlink.app/mcp`): `list_templates` → `get_template` → `create_from_template` (`check_template_data` when you want the report without creating).

- POST https://chartlink.app/api/assets with the example's shape: template, knobs, your data (publish: true when it is final). Over MCP: create_from_template.
- A 201 means it validated and rendered; the response carries urls.embedIframe, urls.png and urls.page, and a preview to look at.
- Anything beyond the knobs is the advanced path: a config object, deep-merged after the knobs — the manual at /llms-full.txt.

## Similar templates

- Map of Berlin by planning area, one number per planning area: https://chartlink.app/templates/map-berlin-planning-areas.md
- Map of Madrid by district, one number per district: https://chartlink.app/templates/map-madrid-districts.md
- Map of London by ward, one number per ward: https://chartlink.app/templates/map-london-wards.md
- Map of Paris by IRIS block, one number per IRIS block: https://chartlink.app/templates/map-paris-iris.md
- Map of Madrid by barrio, one number per barrio: https://chartlink.app/templates/map-madrid-barrios.md
- Map of New York City by ZIP code, one number per ZIP code: https://chartlink.app/templates/map-new-york-city-zip-codes.md
- Map of Tokyo by ward, one number per ward: https://chartlink.app/templates/map-tokyo-wards.md
- Map of Paris by arrondissement, one number per arrondissement: https://chartlink.app/templates/map-paris-arrondissements.md

All templates: https://chartlink.app/llms.txt · The engine behind them: https://chartlink.app/llms-full.txt