vega_gold_bars
= {
let obj = {
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title" : {
"fontSize" : 24,
"anchor" : "start",
"text" : "Слои"
},
"width" : 600,
"height" : 400
}
obj.data = {
"values" : chinaVSusa
};
obj.mark = "line";
obj.layer = [
{
"mark" : {"type" : "bar" , "xOffset": -2 , "width" : 4},
encoding : {
"color": {"value": "#e53434"},
"x": {"field": "Data", "type": "temporal" , "title" : "Год"},
"y": {"field": "Китай",
"type": "quantitative" ,
"title" : "Выбросы углекислого газа, ppm" ,
"axis" : {
"format" : "f",
"tickCount": 3
}
}
}
},
{
"mark" : {"type" : "bar" , "xOffset": 2 },
encoding : {
"color": {"value": "#1386f2"},
"x": {"field": "Data", "type": "temporal" },
"y": {"field": "США",
"type": "quantitative" ,
}
}
},
]
return obj;
}