# Pixel (Maps example)

> WestCoast Charts 1.1.5, release, public Core release, on npm. HTML: https://westcoast-charts.com/gallery/maps/pixel/ · Index for agents: https://westcoast-charts.com/llms.txt

The choropleth drawn as a dot (pixel) map.

- Chart type: `map` (Map)
- Collection: Maps · Maps
- Raw configuration: https://westcoast-charts.com/gallery-src/maps/pixel.js
- Standalone example: https://westcoast-charts.com/embed/samples/wcc/gallery/premium/maps/pixel.html

## Setup

```js
import WestCoastCharts from 'west-coast-charts'
import types from 'west-coast-charts/types'
import premium from 'west-coast-charts/premium'
import 'west-coast-charts/maps/world-small-states' // registers the map shapes

WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
```

## Options

```js
const options = {
  "chart": {
    "height": 480,
    "toolbar": {
      "show": false
    },
    "type": "map"
  },
  "series": [
    {
      "name": "Adoption %",
      "data": [
        {
          "id": "DEU",
          "region": "Europe",
          "value": 44.7
        },
        {
          "id": "FRA",
          "region": "Europe",
          "value": 61.8
        },
        {
          "id": "GBR",
          "region": "Europe",
          "value": 66.2
        },
        {
          "id": "ITA",
          "region": "Europe",
          "value": 53.4
        },
        {
          "id": "ESP",
          "region": "Europe",
          "value": 61
        },
        {
          "id": "NLD",
          "region": "Europe",
          "value": 75.9
        },
        {
          "id": "BEL",
          "region": "Europe",
          "value": 86.6
        },
        {
          "id": "CHE",
          "region": "Europe",
          "value": 56.8
        },
        {
          "id": "AUT",
          "region": "Europe",
          "value": 74.3
        },
        {
          "id": "POL",
          "region": "Europe",
          "value": 55.1
        },
        {
          "id": "SWE",
          "region": "Europe",
          "value": 40.5
        },
        {
          "id": "NOR",
          "region": "Europe",
          "value": 50.3
        },
        {
          "id": "DNK",
          "region": "Europe",
          "value": 43
        },
        {
          "id": "FIN",
          "region": "Europe",
          "value": 56
        },
        {
          "id": "IRL",
          "region": "Europe",
          "value": 57.7
        },
        {
          "id": "PRT",
          "region": "Europe",
          "value": 69.6
        },
        {
          "id": "CZE",
          "region": "Europe",
          "value": 64.3
        },
        {
          "id": "HUN",
          "region": "Europe",
          "value": 48.1
        },
        {
          "id": "ROU",
          "region": "Europe",
          "value": 43.9
        },
        {
          "id": "GRC",
          "region": "Europe",
          "value": 62.2
        },
        {
          "id": "SVK",
          "region": "Europe",
          "value": 59.1
        },
        {
          "id": "BGR",
          "region": "Europe",
          "value": 74
        },
        {
          "id": "HRV",
          "region": "Europe",
          "value": 35.1
        },
        {
          "id": "SRB",
          "region": "Europe",
          "value": 85.3
        },
        {
          "id": "SVN",
          "region": "Europe",
          "value": 74.2
        },
        {
          "id": "LTU",
          "region": "Europe",
          "value": 80.2
        },
        {
          "id": "LVA",
          "region": "Europe",
          "value": 33.2
        },
        {
          "id": "EST",
          "region": "Europe",
          "value": 69.6
        },
        {
          "id": "UKR",
          "region": "Europe",
          "value": 55.9
        },
        {
          "id": "BLR",
          "region": "Europe",
          "value": 48.5
        },
        {
          "id": "ISL",
          "region": "Europe",
          "value": 44.8
        },
        {
          "id": "USA",
          "region": "North America",
          "value": 74.1
        },
        {
          "id": "CAN",
          "region": "North America",
          "value": 49.4
        },
        {
          "id": "MEX",
          "region": "North America",
          "value": 53.9
        },
        {
          "id": "GTM",
          "region": "North America",
          "value": 73.3
        },
        {
          "id": "CRI",
          "region": "North America",
          "value": 71.2
        },
        {
          "id": "PAN",
          "region": "North America",
          "value": 96.9
        },
        {
          "id": "CUB",
          "region": "North America",
          "value": 78.2
        },
        {
          "id": "DOM",
          "region": "North America",
          "value": 70.7
        },
        {
          "id": "BRA",
          "region": "South America",
          "value": 20.9
        },
        {
          "id": "ARG",
          "region": "South America",
          "value": 23.6
        },
        {
          "id": "CHL",
          "region": "South America",
          "value": 16.6
        },
        {
          "id": "COL",
          "region": "South America",
          "value": 30
        },
        {
          "id": "PER",
          "region": "South America",
          "value": 33.5
        },
        {
          "id": "URY",
          "region": "South America",
          "value": 21
        },
        {
          "id": "ECU",
          "region": "South America",
          "value": 18.4
        },
        {
          "id": "VEN",
          "region": "South America",
          "value": 16.9
        },
        {
          "id": "BOL",
          "region": "South America",
          "value": 27.9
        },
        {
          "id": "PRY",
          "region": "South America",
          "value": 34.5
        },
        {
          "id": "JPN",
          "region": "Asia",
          "value": 45.9
        },
        {
          "id": "KOR",
          "region": "Asia",
          "value": 35.1
        },
        {
          "id": "CHN",
          "region": "Asia",
          "value": 46.3
        },
        {
          "id": "IND",
          "region": "Asia",
          "value": 27
        },
        {
          "id": "IDN",
          "region": "Asia",
          "value": 43.9
        },
        {
          "id": "SGP",
          "region": "Asia",
          "value": 21
        },
        {
          "id": "MYS",
          "region": "Asia",
          "value": 25.3
        },
        {
          "id": "THA",
          "region": "Asia",
          "value": 28.2
        },
        {
          "id": "VNM",
          "region": "Asia",
          "value": 37.7
        },
        {
          "id": "PHL",
          "region": "Asia",
          "value": 44.9
        },
        {
          "id": "ISR",
          "region": "Asia",
          "value": 36.6
        },
        {
          "id": "ARE",
          "region": "Asia",
          "value": 46.1
        },
        {
          "id": "SAU",
          "region": "Asia",
          "value": 44.1
        },
        {
          "id": "TUR",
          "region": "Asia",
          "value": 35.2
        },
        {
          "id": "KAZ",
          "region": "Asia",
          "value": 46.8
        },
        {
          "id": "PAK",
          "region": "Asia",
          "value": 23.2
        },
        {
          "id": "BGD",
          "region": "Asia",
          "value": 32.2
        },
        {
          "id": "LKA",
          "region": "Asia",
          "value": 23.7
        },
        {
          "id": "AUS",
          "region": "Oceania",
          "value": 67.3
        },
        {
          "id": "NZL",
          "region": "Oceania",
          "value": 48.9
        },
        {
          "id": "ZAF",
          "region": "Africa",
          "value": 12.5
        },
        {
          "id": "NGA",
          "region": "Africa",
          "value": 8.8
        },
        {
          "id": "EGY",
          "region": "Africa",
          "value": 11.4
        },
        {
          "id": "KEN",
          "region": "Africa",
          "value": 13.5
        },
        {
          "id": "MAR",
          "region": "Africa",
          "value": 9.8
        },
        {
          "id": "GHA",
          "region": "Africa",
          "value": 14.1
        },
        {
          "id": "ETH",
          "region": "Africa",
          "value": 13.5
        },
        {
          "id": "TZA",
          "region": "Africa",
          "value": 12.5
        },
        {
          "id": "DZA",
          "region": "Africa",
          "value": 8.5
        },
        {
          "id": "TUN",
          "region": "Africa",
          "value": 15.2
        },
        {
          "id": "SEN",
          "region": "Africa",
          "value": 16.7
        },
        {
          "id": "CIV",
          "region": "Africa",
          "value": 11.8
        },
        {
          "id": "AGO",
          "region": "Africa",
          "value": 14.9
        }
      ]
    }
  ],
  "plotOptions": {
    "map": {
      "map": "world-small-states",
      "style": "dots",
      "dots": {
        "spacing": 7,
        "size": 0.75
      }
    }
  },
  "theme": {
    "mode": "light",
    "preset": "coastal"
  }
}

const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render()
```

## Verify

- Text check (Library 1.1.5): load `west-coast-charts/agent/describe` and call `chart.describe({ format: "json" })` for the actual drawn state. The live reader is on this example’s HTML page.
- Command line (Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm, https://westcoast-charts.com/docs/cli/index.md): `wcc chart export maps-pixel.json --out maps-pixel.svg --with-table` (save the options above as JSON first)
