Sep 26, 2023 08:52 AM - edited Sep 26, 2023 08:55 AM
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.
Jan 20, 2024 12:04 PM
Greetings, I'm also getting a message when I use the "repeat" property. Did you find an answer to this? Thanks.
Jan 22, 2024 07:00 AM
No, I never figured it out 😞 I hope you have better luck!
Jan 24, 2024 11:11 AM
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. ✌️