vega({
data: { values: nineteen_to_twentyfour_2018 },
width: 500,
height: 400,
title: 'Hong Kong Air Quality in 2018 (19 - 24 pm)',
mark: 'rect',
selection: { highlight: {type: "single"}} ,
encoding: {
x: { field: 'month', type: 'o' },
y: { field: 'location', type: 'n' },
color: {
field: 'avg_monthly_aqhi',
type: 'q',
scale: { scheme: 'blueorange', domain: [1.5, 6] }
},
opacity: {
condition: { selection: "highlight", value: 1},
value: 0.5
}
}
})