viewof view = embed({
$schema: 'https://vega.github.io/schema/vega-lite/v3.json',
width: 360,
data: {
values: [
{tempo: 1, temperatura: semana1}, {tempo: 2, temperatura: semana2}, {tempo: 3, temperatura: semana3}
],
name: 'source'
},
"hconcat": [
{
"title": "Semanas sobrepostas",
"width": 200,
"mark": {
"type": "bar"
},
"encoding": {
"y": {
"field": "temperatura",
"type": "quantitative",
"stack": null
},
"color": {
"field": "tempo",
"type": "ordinal",
"scale": {
"range": [
"#EF9F82",
"#EF634E",
"#DA1C25"
]
}
},
"opacity": {
"value": 0.6
}
}
}, {
"title": "Não sobrepostas",
"width": 200,
"mark": {
"type": "bar"
},
"encoding": {
"x": {
"field": "tempo",
"type": "ordinal"
},
"y": {
"field": "temperatura",
"type": "quantitative",
"stack": null
},
"color": {
"field": "tempo",
"type": "ordinal",
"scale": {
"range": [
"#EF9F82",
"#EF634E",
"#DA1C25"
]
}
},
"opacity": {
"value": 1
}
}
}
]
})