Legend shapes disappear with transparent fill
See original GitHub issueSee https://github.com/vega/vega-lite/issues/2719.
{
"$schema": "https://vega.github.io/schema/vega/v3.0.json",
"data": [
{
"name": "source_0",
"url": "data/cars.json",
"format": {
"type": "json",
"parse": {
"Horsepower": "number",
"Miles_per_Gallon": "number"
}
}
}
],
"scales": [
{
"name": "shape",
"type": "ordinal",
"domain": {"data": "source_0","field": "Cylinders","sort": true},
"range": "symbol"
}
],
"legends": [
{
"shape": "shape",
"title": "Cylinders"
},
{
"shape": "shape",
"title": "Cylinders",
"encode": {
"symbols": {"update": {"fill": {"value": "transparent"}}}
}
}
]
}

Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Fill and Color Legend Disappear while Adding Layers
Shape 21 has fill instead of color. However, I want to keep everything else the same. To save typing, I first remove the...
Read more >Working with legends—Help | ArcGIS for Desktop
Right-click the data frame in the table of contents and click Properties. Click the General tab. Check the Simulate layer transparency in legends...
Read more >Apply transparency to a shape - Microsoft Support
Select the shape or shapes that you want to make transparent. Right-click, and on the context menu, select Format Shape. In the Format...
Read more >Change object transparency in Pages on Mac - Apple Support
In Pages on your Mac, change the transparency of an image, shape, line, arrow, or video by making it more or less opaque....
Read more >Origin Help - Graph Legends - OriginLab
Click to select the legend then press the Delete key, or right-click and choose Delete from the shortcut menu. To show or hide...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@kanitw is right. I think we need to revert vega/vega-parser#46 and only suppress the default stroke when the fill color is bound to a scale at the top-level of the legend (
{"fill": "fillScale", ...}. We currently suppress the default stroke when a custom fill encoding is applied as well, but this issue clearly shows that this was a poor choice…I confirm 3.0.0-rc5 fixes this issue.