diff --git a/src/components/legend/style.js b/src/components/legend/style.js index 75f8abb4dc7..b93a1232771 100644 --- a/src/components/legend/style.js +++ b/src/components/legend/style.js @@ -461,8 +461,13 @@ module.exports = function style(s, gd) { if(pts.size()) { var cont = (trace.marker || {}).line; var lw = boundLineWidth(pieCastOption(cont.width, d0.pts), cont, MAX_MARKER_LINE_WIDTH, CST_MARKER_LINE_WIDTH); + var tMod = Lib.minExtend(trace, {marker: {line: {width: lw}}}); + // since minExtend do not slice more than 3 items we need to patch line.color here + tMod.marker.line.color = cont.color; + var d0Mod = Lib.minExtend(d0, {trace: tMod}); + stylePie(pts, d0Mod, tMod); } } diff --git a/test/image/baselines/funnelarea_line_width.png b/test/image/baselines/funnelarea_line_width.png index 680837aefc4..817e8db6507 100644 Binary files a/test/image/baselines/funnelarea_line_width.png and b/test/image/baselines/funnelarea_line_width.png differ diff --git a/test/image/baselines/pie_legend_line_color_array.png b/test/image/baselines/pie_legend_line_color_array.png new file mode 100644 index 00000000000..b8a60e30188 Binary files /dev/null and b/test/image/baselines/pie_legend_line_color_array.png differ diff --git a/test/image/mocks/pie_legend_line_color_array.json b/test/image/mocks/pie_legend_line_color_array.json new file mode 100644 index 00000000000..233a8868919 --- /dev/null +++ b/test/image/mocks/pie_legend_line_color_array.json @@ -0,0 +1,41 @@ +{ + "data": [ + { + "type": "pie", + "labels": [ + "a", + "b", + "c", + "yellow" + ], + "values": [ + 1, + 3, + 5, + 7 + ], + "marker": { + "colors": [ + "pink", + "lightgreen", + "skyblue", + "orange" + ], + "line": { + "width": 5, + "color": [ + "red", + "green", + "blue", + "yellow" + ] + } + } + } + ], + "layout": { + "width": 400, + "height": 400, + "title": { "text": "pie-like legend with line.color array of length > 3" } + } +}