Hi @Journey_Ebels ,
I used your data and added 2 more rows. Main point was using the transform
and fold
to create the array
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "Table 1",
"width": "container",
"height": "container",
"transform": [
{
"fold": [
"Email hours",
"Dev hours",
"Code Review hours",
"Assist hours"
],
"as": [
"key",
"value"
]
}
],
"mark": "bar",
"encoding": {
"x": {
"field": "Name",
"type": "nominal"
},
"y": {
"field": "value",
"type": "quantitative"
},
"color": {
"type": "nominal",
"field": "key"
}
}
}
This should look like it:

I hope this helps!
Hi @Journey_Ebels ,
I used your data and added 2 more rows. Main point was using the transform
and fold
to create the array
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "Table 1",
"width": "container",
"height": "container",
"transform": [
{
"fold": [
"Email hours",
"Dev hours",
"Code Review hours",
"Assist hours"
],
"as": [
"key",
"value"
]
}
],
"mark": "bar",
"encoding": {
"x": {
"field": "Name",
"type": "nominal"
},
"y": {
"field": "value",
"type": "quantitative"
},
"color": {
"type": "nominal",
"field": "key"
}
}
}
This should look like it:

I hope this helps!
That’s perfect, thank you so much!
Hi @Journey_Ebels ,
I used your data and added 2 more rows. Main point was using the transform
and fold
to create the array
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "Table 1",
"width": "container",
"height": "container",
"transform": [
{
"fold": [
"Email hours",
"Dev hours",
"Code Review hours",
"Assist hours"
],
"as": [
"key",
"value"
]
}
],
"mark": "bar",
"encoding": {
"x": {
"field": "Name",
"type": "nominal"
},
"y": {
"field": "value",
"type": "quantitative"
},
"color": {
"type": "nominal",
"field": "key"
}
}
}
This should look like it:

I hope this helps!
@Greg_F this is very helpful. Do you know if it is also possible to turn the stacked bars into 100% instead of sum/count? Many thanks