Hello,
My requirement is to get dual axis charts in wrapped facet as in below link.
I have used the same code with my data , but wasn't getting independent Y axes for dual charts as below :
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": {
"%context%": true,
"index": "index_paincure_0709",
"body": {
"size": 10000,
"_source": ["Media_Type", "Unit_Key_Message", "Readability"]
}
},
"format": {"property": "hits.hits"}
},
"facet": {"field": "_source.Media_Type", "type": "ordinal", "title": ""},
"center": true,
"columns": 2,
"spec": {
"layer": [
{
"mark": "bar",
"encoding": {
"y": {
"aggregate": "sum",
"field": "_source.Readability",
"type": "quantitative",
"scale": {"zero": false}
},
"x": {
"field": "_source.Unit_Key_Message",
"type": "ordinal",
"sort": "-x",
"title": ""
}
}
},
{
"mark": "line",
"encoding": {
"y": {
"aggregate": "count",
"field": "_source.Unit_Key_Message",
"type": "quantitative",
"scale": {"zero": false}
},
"x": {
"field": "_source.Unit_Key_Message",
"type": "ordinal",
"sort": "-x",
"title": ""
},
"color": {"value": "#000000"}
}
}
],
"resolve": {"scale": {"y": "independent"}, "axis": {"y": "independent"}}
},
"resolve": {
"scale": {"x": "independent", "y": "independent"},
"axis": {"y": "independent"}
},
"config": {"bar": {"align": "center"}}
}