Resizing of visualization whenever size of visualization is changed in dashboard

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {"url": "https://vega.github.io/vega-lite/data/barley.json"},
    "width": 300,
"height":300,
  "mark": "bar",
  "encoding": {
   "column": {"field": "year"},
 
    "x": {"field": "yield", "type": "quantitative", "aggregate": "sum"},
    "y": {"field": "variety", "type": "nominal"},
    "color": {"field": "site", "type": "nominal"}
  }
}

Output :

Other visualizations without column are getting resized as per dimensions of visualization in dashboard (the whole visualization gets occupied). But whenever column is included its not getting resized in dashboard. Is there any way to solve this ?

Short answer: you can't do this while using column encodings, you can only do this if you have a single view in Vega. This is documented by the Vega folks.

However, if you are using a single Vega view, not multiple, then the default behavior of Kibana is to autosize. This is documented in the Kibana Vega reference.

Hi @wylie

Is there any way that these bar graphs can be center aligned in the visualization ?

I think you can set the center: true property in column, but I haven't tested this. It's part of the general encodings for facets in Vega-Lite:

yes, tried that it wasn't working.

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