I’m testing some data in a Vega Lite chart, that works in Vegas online editor but not in the Losant spec editor. I just want to bin some data. The first spec is working, the second is not.
Spec1.
{
"width": {{block.width}},
"height": {{block.height}},
"autosize": {
"type": "fit",
"contains": "padding"
},
"description": "A simple time series chart.",
"data": {
"values": [
{"a": "C", "b": 2},
{"a": "C", "b": 2},
{"a": "C", "b": 3},
{"a": "D", "b": 3},
{"a": "D", "b": 5},
{"a": "D", "b": 5},
{"a": "E", "b": 5},
{"a": "E", "b": 8},
{"a": "E", "b": 9}
]
},
"mark": "point",
"encoding": {
"x": { "field": "a", "type": "ordinal" },
"y": { "field": "b", "type": "ordinal" }
}
}
Spec 2.
{
"width": {{block.width}},
"height": {{block.height}},
"autosize": {
"type": "fit",
"contains": "padding"
},
"description": "A simple time series chart.",
"data": {
"values": [
{"a": "C", "b": 2},
{"a": "C", "b": 2},
{"a": "C", "b": 3},
{"a": "D", "b": 3},
{"a": "D", "b": 5},
{"a": "D", "b": 5},
{"a": "E", "b": 5},
{"a": "E", "b": 8},
{"a": "E", "b": 9}
]
}"mark": "bar",
"encoding": {
"x": {"bin":{"binned": true, "step": 1},"field": "b"}
, "y": {"aggregate": "count"}}
}