bivariateMap = eurostatmap
.map("chbi")
.width(width / 1.3)
.svgId("bivariate")
.title("Unemployment and population density")
.subtitle(
"% share of unemployed persons aged 20-64 years & inhabitants per km²"
)
.titleFontSize(24)
.subtitleFontSize(16)
.nutsLvl(1)
.nutsYear(2016)
.stat("v1", { eurostatDatasetCode: "demo_r_d3dens", unitText: "inh./km²" })
.stat("v2", {
eurostatDatasetCode: "lfst_r_lfu3rt",
filters: { age: "Y20-64", sex: "T", unit: "PC", time: 2019 },
unitText: "% unemployed"
})
.classToFillStyle((i, j) => {
if (i == 0 && j == 2) return colors[6];
if (i == 1 && j == 2) return colors[7];
if (i == 2 && j == 2) return colors[8];
if (i == 0 && j == 1) return colors[3];
if (i == 1 && j == 1) return colors[4];
if (i == 2 && j == 1) return colors[5];
if (i == 0 && j == 0) return colors[0];
if (i == 1 && j == 0) return colors[1];
if (i == 2 && j == 0) return colors[2];
return "gray";
})