<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/piximaps.min.css">
<script src="js/piximaps.min.js"></script>
<style>
#chart { width: 540px; height: 540px; box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37); }
.pixi .charttitle .subtitle { font-size: 0.9em; font-style: italic; text-anchor: start }
</style>
<script>
window.addEventListener('load', () => {
'use strict';
// Set the map attributes:
const map = {
type: 'geojson',
url: '/maps/ne_110m_admin_0_countries',
include: { CONTINENT: 'Europe' },
exclude: { SOVEREIGNT: ['Russia'] },
coordinates: [54.63716564941769, 5.367051],
zoom: 6,
minZoom: 0.5,
maxZoom: 10,
};
const series = [
{ title: 'Eurozone', style: { fillColor: '#2196F3' } },
{ title: 'Others', style: { fillColor: '#009688' } }
];
// Define the chart settings:
const opts = {
chart: {
width: window.innerWidth < (540 * 0.8) ? (window.innerWidth * 0.8) : 540,
height: window.innerHeight < 540 ? window.innerHeight : 540,
},
title: { label: 'European Union' },
footer: { label: 'Source Wikipedia.', x: 3, y: 0 },
legend: {
enabled: true,
layout: 'horizontal',
align: { horizontal: 'middle', vertical: 'bottom' },
shift: { y: -10 },
},
};
// Define a list of map ids and set their properties:
const countries = [
{'AUT-A': { title: 'Austria', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '83,879 km²', 'Population': '8,579,747' }}},
{'BEL-B': { title: 'Belgium', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '30,528 km²', 'Population': '11,239,755' }}},
{'BGR-BG': { title: 'Bulgaria', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '110,994 km²', 'Population': '7,364,570', Currency: 'Bulgarian lev'}}},
{'CYP-CY': { title: 'Cyprus', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '9,251 km²', 'Population': '1,117,00' }}},
{'CZE-CZ': { title: 'Czech Rep.', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '78,866 km²', 'Population': '10,538,275', Currency: 'Czech koruna'}}},
{'DEU-D': { title: 'Germany', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '357,168 km²', 'Population': '80,716,000' }}},
{'DNK-DK': { title: 'Denmark', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '42,915 km²', 'Population': '5,668,743', Currency: 'Danish krone'}}},
{'ESP-E': { title: 'Spain', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '504,645 km²', 'Population': '46,464,053' }}},
{'EST-EST': { title: 'Estonia', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '45,227 km²', 'Population': '1,313,271' }}},
{'FIN-FIN': { title: 'Finland', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '338,424 km²', 'Population': '5,477,359' }}},
{'FRA-F': { title: 'France', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '640,679 km²', 'Population': '66,616,416' }}},
{'GBR-GB': { title: 'United Kingdom', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '243,610 km²', 'Population': '64,511,000', Currency: 'pound sterling'}}},
{'GRC-GR': { title: 'Greece', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '131,957 km²', 'Population': '10,816,286' }}},
{'HRV-HR': { title: 'Croatia', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '56,594 km²', 'Population': '4,284,889', Currency: 'Croatian Kuna'}}},
{'HUN-HU': { title: 'Hungary', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '93,030 km²', 'Population': '9,877,365', Currency: 'Hungarian Forint'}}},
{'IRL-IRL': { title: 'Ireland', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '84,421 km²', 'Population': '6,378,000' }}},
{'ITA-I': { title: 'Italy', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '301,338 km²', 'Population': '60,782,668' }}},
{'LTU-LT': { title: 'Lithuania', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '65,300 km²', 'Population': '2,912,566' }}},
{'LUX-L': { title: 'Luxembourg', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '2,586 km²', 'Population': '549,680' }}},
{'LVA-LV': { title: 'Latvia', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '64,589 km²', 'Population': '1,997,500' }}},
{'NLD-NL': { title: 'Netherlands', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '41,543 km²', 'Population': '16,912,640' }}},
{'POL-PL': { title: 'Poland', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '312,679 km²', 'Population': '38,483,957', Currency: 'Polish Złoty'}}},
{'PRT-P': { title: 'Portugal', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '92,212 km²', 'Population': '10,427,301' }}},
{'ROU-RO': { title: 'Romania', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '238,391 km²', 'Population': '19,942,642', Currency: 'Romanian Leu'}}},
{'SVK-SK': { title: 'Slovakia', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '49,035 km²', 'Population': '5,415,949' }}},
{'SVN-SLO': { title: 'Slovenia', style: {fillColor: '#2196F3', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '20,273 km²', 'Population': '2,061,085' }}},
{'SWE-S': { title: 'Sweden', style: {fillColor: '#009688', fillOpacity: 0.75}, over: {fillOpacity: 1}, properties: { 'Area': '450,295 km²', 'Population': '9,760,142', Currency: 'Swedish krona'}}},
];
// Fix the chart dimensions:
const el = document.getElementById('chart');
el.style.width = opts.chart.width + 'px';
el.style.height = opts.chart.height + 'px';
// Draw the chart:
Pixi.Map('#chart', map, series, opts).overlayUpdate(countries);
});
</script>
</head>
<body>
<div id="chart" class="pixi"></div>
</body>
</html>