Vega-lite invalid spec error

I am just trying to do a simple count of all container_id 's for every state in vega-lite and it thorws an error as invalid spec. What am I doing wrong here?

{
  "$schema": "https://vega.github.io/schema/vega-lite/v2.json",
  "title": "Event counts from all indexes",
  "data": {
    "url": {
      "index": "my_index",
      "body": {
        "mark": "bar",
        "encoding": {
          "x": {"field": "currDetails_state"},
          "y": {"aggregate": "distinct", "field": "currDetails_container_id.keyword", "type": "quantitative"}
        }
      }
    }
  }
}

The "mark" specification should not be underneath the "data" specification; they should be at the same level. Please see structuring in the vega-lite examples. Also, please expand the last item here labeled ▶ Expand final Vega-Lite spec

Thank you Robert. That fixed the error.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.