← Madridchartlink · choropleth
Madrid by: neighbourhoods (barrios) · districts (distritos)
Map of Madrid by barrio, one number per barrio
Also: Madrid map by barrio · mapa de Madrid por barrios · map of Madrid's 131 neighbourhoods · Madrid barrios choropleth · mapa barrios Madrid

Example: Population of Madrid's barrios, 2026 — Registered residents (padrón) on 1 January 2026 by barrio. Valdebernardo-Valderrivas, Aluche and El Cañaveral lead; the barrios of the old centre and the airport are the smallest. District lines are drawn on top.
About this template
Data: one row per barrio with its code (11 for Palacio, 45 for Castellana) or its name, and a number. A barrio with no row stays grey. Codes are the barrio numbers (district number followed by the barrio's number within it, 11–215); the barrio name matches, with its district where a name repeats. Same design as the other city maps, so they sit together.
A choropleth map of the regions of the "madrid-barrios" geography, each region filled by one number from your data (the "population" column). The borders of the "madrid-districts" regions are drawn on top of the regions in dark navy blue, 0.5 units wide, so the finer regions read inside their larger units.
A sequential colour scale from pale blue for the smallest values to deep navy blue for the largest; pinned to 5000 to 60000, 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.3-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 — barrio (string, "Barrio (code or name)"), population (number, "Population (padrón), 1 January 2026") — and 131 rows in the example "Population of Madrid's barrios, 2026". 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_csuuB5pTv7kyF5QFT6DLq; buckets (with the values in classes and a swatch legend): ast_lKlDIco6XWJ0t3K5X3V4R; editorial (in the editorial house style — serif type on paper, a green ramp): ast_jxgnmllFHx6GRRixR9oCH; categories (with a text category per region and a swatch legend): ast_NyLu0duzu1Z7OtXA5QxzW; buckets-dark (with the values in classes and a swatch legend, on a dark canvas): ast_nnZGfUOsJPK47pnFeIni9; surroundings (with the land around the place drawn in grey): ast_uFkgM5wN4ttbImhUS1BzG; categories-dark (with a text category per region and a swatch legend, on a dark canvas): ast_nrNLRasquokK1eOnZmTpa; buckets-editorial (with the values in classes and a swatch legend, in the editorial house style — serif type on paper, a green ramp): ast_BE2AXwgmxLbcyWiuaqTRX; dark-surroundings (on a dark canvas, with the land around the place drawn in grey): ast_35KgZsGx4ynlbqUfFv0W5; buckets-surroundings (with the values in classes and a swatch legend, with the land around the place drawn in grey): ast_mWTOoqnl50AIXsqXU6Ijc; 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_KM8GFGyrLM2sUwOjvj6To; editorial-surroundings (in the editorial house style — serif type on paper, a green ramp, with the land around the place drawn in grey): ast_DTqR7jzkutne5zdzDAwUy; categories-surroundings (with a text category per region and a swatch legend, with the land around the place drawn in grey): ast_w1ynWpZzdFRX6u2QmUbyF; 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_Yra5XULlZXGiEfQyFAWpY; 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_BH2jG4oQln1x4ftHeveQJ; 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_Q4eEphQFP5vKeZCRKNafY; 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_RUPcsxMQwcjTpJe6OzFMa. On the page, switch with the toggles; an agent passes that id as the template instead.
Use it with your agent
Copy the prompt, paste it into Claude, ChatGPT, Cursor or any agent with the chartlink MCP server or API, and give it your numbers. It rebuilds this exact design with your data and hands back an embed, a PNG and a page.
The prompt in full
Data this template expects
| column id | type | in the example |
|---|---|---|
| barrio | string | Barrio (code or name) |
| population | number | Population (padrón), 1 January 2026 |
131 rows in the example. Your data keeps these column ids; everything else about the chart comes from the template.
For agents: the API call
POST https://chartlink.app/api/assets
{
"template": "ast_DXeLCavupypGj9RY4StwR",
"knobs": {
"theme": "light",
"dataType": "gradient",
"title": {
"text": "Your title"
},
"source": {
"text": "Where the numbers come from"
}
},
"data": {
"columns": [
{
"id": "barrio",
"type": "string"
},
{
"id": "population",
"type": "number"
}
],
"rows": [
[
"…"
]
]
},
"publish": true
}The recipe (the template's settings)
{
"chart": {
"domain": [
5000,
60000
],
"format": {
"kind": "number",
"compact": true,
"decimals": 1
},
"borders": {
"color": "#1f2937",
"width": 0.5,
"geography": "madrid-districts"
},
"outline": {
"width": 0.3
},
"geography": "madrid-barrios"
},
"title": {
"text": "Population of Madrid's barrios, 2026"
},
"preset": "map-light",
"source": {
"url": "https://datos.madrid.es/dataset/300557-0-poblacion-distrito-barrio",
"text": "Ayuntamiento de Madrid, padrón municipal, población por distrito y barrio"
},
"encoding": {
"value": {
"column": "population"
},
"region": {
"column": "barrio"
}
},
"description": {
"text": "Registered residents (padrón) on 1 January 2026 by barrio. Valdebernardo-Valderrivas, Aluche and El Cañaveral lead; the barrios of the old centre and the airport are the smallest. District lines are drawn on top."
}
}map · choropleth · madrid · barrios · city · city-districts
Similar templates
- Map of Madrid by district, one number per district
- Map of London by ward, one number per ward
- Map of Berlin by planning area, one number per planning area
- Map of Paris by IRIS block, one number per IRIS block
- Map of New York City by ZIP code, one number per ZIP code
- Map of Tokyo by ward, one number per ward
- Map of Berlin by district, one number per district
- Map of Paris by arrondissement, one number per arrondissement
- All templates →