Vega-lite: legend's symbolOpacity does not work

Created on 7 Jul 2020  路  4Comments  路  Source: vega/vega-lite

background

I can't pass a different opacity to the legend symbols than what is given to all the marks. I want the legend symbols to have 100% opacity. On SO, @jakevdp pointed me here!

reprex (Vega Editor link)

{
  "data": {"url": "https://vega.github.io/vega-datasets/data/cars.json"},
  "mark": {"type": "circle", "opacity": 0.1},
  "encoding": {
    "color": {
      "field": "Origin",
      "type": "nominal",
      "legend": {"symbolOpacity": 1}
    },
    "x": {"field": "Horsepower", "type": "quantitative"},
    "y": {"field": "Miles_per_Gallon", "type": "quantitative"}
  }
}
Bug P2

Most helpful comment

Thank you for the bug report @swanderz. Fixed in https://github.com/vega/vega-lite/pull/6724.

All 4 comments

symbolStrokeColor also doesn't work as expected.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "description": "A bubbleplot showing horsepower on x, miles per gallons on y, and binned acceleration on size.",
  "data": {"url": "data/cars.json"},
  "mark": "point",
  "encoding": {
    "x": {"field": "Horsepower", "type": "quantitative"},
    "y": {"field": "Miles_per_Gallon", "type": "quantitative"},
    "size": {"field": "Acceleration", "type": "quantitative", "legend": {
      "symbolStrokeColor": "red"
    }}
  }
}

Thank you for the bug report @swanderz. Fixed in https://github.com/vega/vega-lite/pull/6724.

image

I <3 鈥榲ega-lite`! Thanks @domoritz

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kanitw picture kanitw  路  3Comments

kanitw picture kanitw  路  3Comments

domoritz picture domoritz  路  3Comments

kanitw picture kanitw  路  4Comments

infai-feineis picture infai-feineis  路  3Comments