Help

"Property xOffset is not allowed" attempting to create a grouped bar chart (Vega Lite)

Topic Labels: Extensions
154 0
cancel
Showing results for 
Search instead for 
Did you mean: 
adr4
4 - Data Explorer
4 - Data Explorer

Hello,

I am trying to create a "grouped bar chart (multiple measure with repeat)" (example). No matter what I try, I continue to get a "Property xOffset is not allowed" error and the chart won't render. At first it kind of produces a stacked chart (but even then, I don't think it is correctly visualizing the data). Then when I make a minor edit to the code, I get the xOffset error. Here is a test base with data and the vega-lite extension: https://airtable.com/appYMp2wIMhSqMTjt/shr1a3hegi7HrSVga

Here is the code:

{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"title": "Streaming Video Comparison",
"repeat": {"layer": ["Searches", "Full Text Views"]},
"spec": {
"width": 500,
"height": 250,
"mark": "bar",
"encoding": {
"x": {"field": "Database","type": "nominal"},
"y": {
"aggregate": "sum",
"field": {"repeat": "layer"},
"type": "quantitative",
"title": "Searches & Full Text Views: Total # "
},
"color": {"datum": {"repeat": "layer"},"type": "nominal"},
"xOffset": {"datum": {"repeat": "layer"}}
}
}
}

Any insights on how to get this to work are welcomed. Thank you.

0 Replies 0