'Vegalite on the left is a binned bar chart, want corresponding bar to be selected on the left and the chart on right to show the bar within range

On the left is a binned bar chart, I want the corresponding bar to be selected on the left and the chart on the right to show the chart within that range

    {
      "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
      "data": {"url": "data/movies.json"},
      "hconcat": [
        {
          "mark": "bar",
          "params": [{"name": "select", "select": "point"}],
          "encoding": {
            "x": {"bin": true, "field": "IMDB Rating", "type": "ordinal"},
            "y": {"aggregate": "count"}
          }
        },
        {
          "mark": "bar",
          "transform": [{"filter": {"param": "select"}}],
          "encoding": {
            "x": {"field": "IMDB Rating", "type": "ordinal"},
            "y": {"aggregate": "count"}
          }
        }
      ]
    }

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source