Sep 03, 2021 03:34 PM
I just found the vega-lite block today and am trying to get a stacked bar graph using 2 fields. I stumbled onto the fold example (Fold | Vega-Lite) and was able to convert it to stacked instead of columns… and it looks like exactly what I want inside the vega-lite editor. But inside airtable, it seems that it doesn’t like the return “key” and “value” from the fold command. Gives the error:
value is not a valid transform name, inline data name, or field name from the Table1 table:
Anyone know if I’m doing something wrong, if this is missing functionality in airtable, or a bug?
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "Table1",
"width": "container",
"height": "container",
"transform": [{"fold": ["Field1","Field2"]}],
"mark": "bar",
"encoding": {
"x": {
"field": "NAME",
"type": "nominal"
},
"y": {
"type": "quantitative",
"field": "value"
},
"color": {
"field": "key",
"type": "nominal",
"scale": {"range": ["#c49712", "#999"]
}
}
}
}
Edit- Add link to fold example
Solved! Go to Solution.
Sep 07, 2021 04:10 PM
Support got back. Correct line should be
“transform”: [{“fold”: [“Field1”,“Field2”], “as”:[“key”, “value”]}]
Sep 07, 2021 04:10 PM
Support got back. Correct line should be
“transform”: [{“fold”: [“Field1”,“Field2”], “as”:[“key”, “value”]}]