You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to combine legends when using line mark with "point": true or separate line and point layers #9748
With the above spec I would expect the legend to have one section "Type" and to include one legend value per type, with the color and shape represented per value on the legend:
However, what I get are two distinct legends, one for the shape, and one for the color. If I change the mark to use point like so:
Here is another visualization that I created that shows the same problem, but with a slightly different Vega-Lite spec. Here is the spec without the data (the link to the Vega Editor includes the data):
So, instead of trying to use just the line mark with "point": true I went ahead and created two individual layers, one for the lines, one for the points. Each layer defines their own color encoding, and the point layer includes an encoding for shape. I would expect this to result in a combined legend, but it does not. The results are basically identical to using only the line mark with "point": true. I tried disabling the legend for the line layer but that just drops the color values from the legend.
changed the title [-]Using mark type line with point: true does not combine legends[/-][+]Unable to combine legends when using line mark with "point": true or separate line and point layers[/+]on Jan 9, 2026
Noting that we encounter this issue as well when attempting to use a shape mark to apply symbols to different series in a stacked bar chart for accessibility purposes (need a non-color way to differentiate them).
Activity
labkey-alan commentedon Jan 9, 2026
Here is another visualization that I created that shows the same problem, but with a slightly different Vega-Lite spec. Here is the spec without the data (the link to the Vega Editor includes the data):
{ "$schema": "https://vega.github.io/schema/vega-lite/v6.json", "data": { "values": [] }, "layer": [ { "mark": {"type": "line", "point": false}, "encoding": { "color": {"field": "type.value", "type": "nominal", "title": "Type"} } }, { "mark": {"type": "point", "opacity": 1, "filled": true, "size": 55}, "encoding": { "color": {"field": "type.value", "type": "nominal", "title": "Type"}, "shape": {"field": "type.value", "type": "nominal", "title": "Type"} } } ], "encoding": { "x": { "field": "maxSpeed.value", "type": "quantitative", "title": "Max Speed" }, "y": {"field": "weight.value", "type": "quantitative", "title": "Weight"} } }So, instead of trying to use just the line mark with
"point": trueI went ahead and created two individual layers, one for the lines, one for the points. Each layer defines their own color encoding, and the point layer includes an encoding for shape. I would expect this to result in a combined legend, but it does not. The results are basically identical to using only the line mark with"point": true. I tried disabling the legend for the line layer but that just drops the color values from the legend.[-]Using mark type line with point: true does not combine legends[/-][+]Unable to combine legends when using line mark with "point": true or separate line and point layers[/+]ByzantineFailure commentedon Mar 19, 2026
Noting that we encounter this issue as well when attempting to use a
shapemark to apply symbols to different series in a stacked bar chart for accessibility purposes (need a non-color way to differentiate them).