Search code examples
powerbivisualizationpowerbi-desktopvega-litedeneb

Vega lite deneb boxplot whisker width changed since update how to change whisker tick width


Previously my boxplots looked like this (note the width of the whiskers): boxplot_old

Since the recent update, they now look like this: boxplot_new

I don't want the whiskers extending beyond the width of the 'box' but I can't find how to adjust this as I didn't set the width in the old version so the default must have changed. How do I change my plots back to how they were?


Solution

  • enter image description here

    You can configure the ticks property (here they are red and 100 pixels long)

    {
      "height":300,
      "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
      "description": "A horizontal box plot showing median and lower and upper quartiles of the distribution of body mass of penguins.",
      "data": {"url": "data/penguins.json"},
      "mark": {
        "type": "boxplot",
        "extent": 1.5,
        "median": {"color": "red"},
        "ticks": {"color":"red", "size":100} 
      },
      "encoding": { 
        "x": {
          "field": "Body Mass (g)",
          "type": "quantitative",
          "scale": {"zero": false}
        }
      }
    }