Search code examples
vega-lite

Columns bar chart: how to remove/hide a class if it's not assigned in a column?


I have a bar chart subdivided into columns by class. Each bar chart is colored by another class.
Sometime the color class is not present in some columns (in the image an example). What's the way to not have it in the single bar chart, if the color class is not assigned?

Here a sample code

enter image description here


Solution

  • I must add (example)

    "resolve": {"scale": {"x": "independent"}}