OK, I have made some progress. If I place all data in one values column, then tag it with a type column and add a colour switch, things start to work.

{
"title": "Data",
"mark": "line",
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": "Data_Value", "type": "quantitative"},
"color": {"field": "Colour", "type": "nominal"}
}
}
But as I’m not keen on pre-formatting my data, I’ll appreciate if anyone can help out with the original structure - I’ll continue to learn as time allows and will post here.
EDIT: I’m sure I’m close, in that I just have to format/layer the data with transform… just wish the doco had some simple examples to follow.
{
"repeat":
{
"layer": "Value_A", "Value_B", "Value_C"]
},
"title": "Data",
"width": 400,
"height": 400,
"mark": "line",
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": {"repeat": "layer","type": "quantitative"}
}
}
}
OK, I have made some progress. If I place all data in one values column, then tag it with a type column and add a colour switch, things start to work.

{
"title": "Data",
"mark": "line",
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": "Data_Value", "type": "quantitative"},
"color": {"field": "Colour", "type": "nominal"}
}
}
But as I’m not keen on pre-formatting my data, I’ll appreciate if anyone can help out with the original structure - I’ll continue to learn as time allows and will post here.
EDIT: I’m sure I’m close, in that I just have to format/layer the data with transform… just wish the doco had some simple examples to follow.
{
"repeat":
{
"layer": "Value_A", "Value_B", "Value_C"]
},
"title": "Data",
"width": 400,
"height": 400,
"mark": "line",
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {"field": {"repeat": "layer","type": "quantitative"}
}
}
}
Omg I think I finally have this sorted…
{ "title": "Data",
"width": 1000,
"height": 400,
"repeat": {
"layer":
"Value_A", "Value_B","Value_C"]},
"spec": {
"mark": "line",
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {
"aggregate": "mean",
"field": {"repeat": "layer"},
"type": "quantitative",
"title": "Value"},
"color": { "datum": {"repeat": "layer"}, "type": "nominal" }
}
}
}

Does anyone know the method of linking up line data if there’s gaps?
Example below - where you can see the Vegalite chart showing multiple line plots from my data, and the Airtable chart plot is still only limited to one (and everyone, please vote with Airtable support to see this improved!) - but note how the Vegalite data is broken and not continuous…

Omg I think I finally have this sorted…
{ "title": "Data",
"width": 1000,
"height": 400,
"repeat": {
"layer": :"Value_A", "Value_B","Value_C"]},
"spec": {
"mark": "line",
"encoding": {
"x": {"field": "Date", "type": "temporal"},
"y": {
"aggregate": "mean",
"field": {"repeat": "layer"},
"type": "quantitative",
"title": "Value"},
"color": { "datum": {"repeat": "layer"}, "type": "nominal" }
}
}
}

I couldn't get ChatGPT to do this. You are an absolute beast, sir. A gentleman and a scholar. 🎊