Set dynamic default values of brushed data on x-axis with dates

36 Views Asked by At

This is a sample of interactive multi-view by using selection

1

Open the Chart in the Vega Editor

"params": [
    {
      "name": "brush",
      "value": {
        "x": [{"year": 2007, "month": 7}, {"year": 2009, "month": 6}]
      },
      "select": {"type": "interval", "encodings": ["x"]}
    }
  ]

In the sample, default values of x-axis are set as below:

{"x": [{"year": 2007, "month": 7}, {"year": 2009, "month": 6}]}

I am trying to set "dynamic" default values for the brushed data on the Overview Chart x-axis

I would like to establish a dynamic default date range selection based on a variable date rather than a fixed month.

For instance,

07-2007 -> 180 days prior to the current maximum date

06-2009 -> the current maximum date

Could you please help me with this?

0

There are 0 best solutions below