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

372 1
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer


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:

Here is the code:

"$schema": "",
"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.

3 Replies 3
5 - Automation Enthusiast
5 - Automation Enthusiast

Greetings,  I'm also getting a message when I use the "repeat" property.  Did you find an answer to this?  Thanks.

No, I never figured it out 😞 I hope you have better luck!

5 - Automation Enthusiast
5 - Automation Enthusiast

Bummer ... I decided to go the route where I exported table data with the API into a simple webpage that spits out a chart.  If you're interested, I can send you some PHP code and show you what I did.  Otherwise, I hope you found a better solution.  ✌️