Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/legend/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
Binary file modified test/image/baselines/funnelarea_line_width.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions test/image/mocks/pie_legend_line_color_array.json
Original file line number Diff line number Diff line change
@@ -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" }
}
}