Bubbles
City sizes as proportional circles, with a size key.
Open the chart without page chrome ↗Drawing width at least 900 px. Scroll within the chart on smaller screens.
const options = {
chart: {
height: 480,
toolbar: {
show: false
},
type: "map"
},
series: [
{
name: "Visitors (m)",
data: [
{
name: "New York",
lon: -74,
lat: 40.7,
value: 5
},
{
name: "London",
lon: -0.13,
lat: 51.5,
value: 30
},
{
name: "Paris",
lon: 2.35,
lat: 48.86,
value: 27
},
{
name: "Berlin",
lon: 13.4,
lat: 52.52,
value: 33
},
{
name: "Tokyo",
lon: 139.69,
lat: 35.69,
value: 18
},
{
name: "Los Angeles",
lon: -118.24,
lat: 34.05,
value: 38
},
{
name: "Singapore",
lon: 103.82,
lat: 1.35,
value: 38
},
{
name: "Delhi",
lon: 77.21,
lat: 28.61,
value: 30
},
{
name: "São Paulo",
lon: -46.63,
lat: -23.55,
value: 20
},
{
name: "Sydney",
lon: 151.21,
lat: -33.87,
value: 16
},
{
name: "Johannesburg",
lon: 28.05,
lat: -26.2,
value: 36
},
{
name: "Mexico City",
lon: -99.13,
lat: 19.43,
value: 23
},
{
name: "Shanghai",
lon: 121.47,
lat: 31.23,
value: 24
},
{
name: "Toronto",
lon: -79.38,
lat: 43.65,
value: 8
},
{
name: "Dubai",
lon: 55.27,
lat: 25.2,
value: 4
},
{
name: "Mumbai",
lon: 72.88,
lat: 19.08,
value: 34
},
{
name: "Seoul",
lon: 126.98,
lat: 37.57,
value: 31
},
{
name: "Madrid",
lon: -3.7,
lat: 40.42,
value: 5
},
{
name: "Lagos",
lon: 3.38,
lat: 6.52,
value: 18
},
{
name: "Buenos Aires",
lon: -58.38,
lat: -34.6,
value: 12
}
]
}
],
plotOptions: {
map: {
fit: "map"
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
chart.render()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' // registers the map shapes
WestCoastCharts.use(types).use(premium)
const WestCoastChartsPremium = premium
WestCoastCharts.setLicenseKey(LICENCE_KEY) // paid production licence; localhost evaluation needs no key
const options = {
chart: {
height: 480,
toolbar: {
show: false
},
type: "map"
},
series: [
{
name: "Visitors (m)",
data: [
{
name: "New York",
lon: -74,
lat: 40.7,
value: 5
},
{
name: "London",
lon: -0.13,
lat: 51.5,
value: 30
},
{
name: "Paris",
lon: 2.35,
lat: 48.86,
value: 27
},
{
name: "Berlin",
lon: 13.4,
lat: 52.52,
value: 33
},
{
name: "Tokyo",
lon: 139.69,
lat: 35.69,
value: 18
},
{
name: "Los Angeles",
lon: -118.24,
lat: 34.05,
value: 38
},
{
name: "Singapore",
lon: 103.82,
lat: 1.35,
value: 38
},
{
name: "Delhi",
lon: 77.21,
lat: 28.61,
value: 30
},
{
name: "São Paulo",
lon: -46.63,
lat: -23.55,
value: 20
},
{
name: "Sydney",
lon: 151.21,
lat: -33.87,
value: 16
},
{
name: "Johannesburg",
lon: 28.05,
lat: -26.2,
value: 36
},
{
name: "Mexico City",
lon: -99.13,
lat: 19.43,
value: 23
},
{
name: "Shanghai",
lon: 121.47,
lat: 31.23,
value: 24
},
{
name: "Toronto",
lon: -79.38,
lat: 43.65,
value: 8
},
{
name: "Dubai",
lon: 55.27,
lat: 25.2,
value: 4
},
{
name: "Mumbai",
lon: 72.88,
lat: 19.08,
value: 34
},
{
name: "Seoul",
lon: 126.98,
lat: 37.57,
value: 31
},
{
name: "Madrid",
lon: -3.7,
lat: 40.42,
value: 5
},
{
name: "Lagos",
lon: 3.38,
lat: 6.52,
value: 18
},
{
name: "Buenos Aires",
lon: -58.38,
lat: -34.6,
value: 12
}
]
}
],
plotOptions: {
map: {
fit: "map"
}
},
theme: {
mode: "light",
preset: "coastal"
}
}
const chart = new WestCoastCharts(document.querySelector('#chart'), options)
await chart.render() Waiting for the chart.
Open Data & agent view to read this chart through chart.describe().
Read from the running library through its optional agent/describe module. Text, table and JSON share the same snapshot. Demo data only.
$ wcc chart export maps-bubbles.json --out maps-bubbles.svg --with-table Public agent tools 0.2.3, tested with Library 1.1.5; available from the versioned GitHub release and npm. Save a JSON spec first and check the loaded runtime and supported modules before rendering. Command reference
Loading /gallery/maps/bubbles/index.md … This example uses Premium modules. Compare licences · Embedding in a distributed product?