Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0223993

Browse files
committed
Fix legend title opacity incorrectly dimming for pie traces with per-slice legend assignments
1 parent e0be8c5 commit 0223993

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

src/components/legend/draw.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,10 @@ function drawOne(gd, opts) {
249249
// Toggle opacity of legend titles if all items in the legend are hidden
250250
const shapes = (fullLayout.shapes || []).filter(function(s) { return s.showlegend; });
251251
const anyVisible = gd._fullData.concat(shapes).some(function(item) {
252-
const inThisLegend = (item.legend || 'legend') === legendId;
252+
const legendAttr = item.legend || 'legend';
253+
var inThisLegend = Array.isArray(legendAttr)
254+
? legendAttr.some(function(legend) { return (legend || 'legend') === legendId; })
255+
: legendAttr === legendId;
253256
return inThisLegend && item.visible === true;
254257
});
255258

13 Bytes
Loading
21 Bytes
Loading
50 Bytes
Loading

0 commit comments

Comments
 (0)