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
17 changes: 9 additions & 8 deletions src/components/legend/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,15 @@ function styleBars(d) {
.attr('transform', 'translate(20,0)');
barpath.exit().remove();
barpath.each(function(d) {
var w = (d.mlw + 1 || markerLine.width + 1) - 1,
p = d3.select(this);
var p = d3.select(this),
d0 = d[0],
w = (d0.mlw + 1 || markerLine.width + 1) - 1;

p.style('stroke-width', w + 'px')
.call(Color.fill, d.mc || marker.color);
.call(Color.fill, d0.mc || marker.color);

if(w) {
p.call(Color.stroke, d.mlc || markerLine.color);
p.call(Color.stroke, d0.mlc || markerLine.color);
}
});
}
Expand All @@ -193,15 +194,15 @@ function styleBoxes(d) {
.attr('d', 'M6,6H-6V-6H6Z')
.attr('transform', 'translate(20,0)');
pts.exit().remove();
pts.each(function(d) {
var w = (d.lw + 1 || trace.line.width + 1) - 1,
pts.each(function() {
var w = trace.line.width,
p = d3.select(this);

p.style('stroke-width', w + 'px')
.call(Color.fill, d.fc || trace.fillcolor);
.call(Color.fill, trace.fillcolor);

if(w) {
p.call(Color.stroke, d.lc || trace.line.color);
p.call(Color.stroke, trace.line.color);
}
});
}
Expand Down
Binary file modified test/image/baselines/bar_marker_array.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 19 additions & 2 deletions test/image/mocks/bar_marker_array.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,26 @@
"#447adb",
"#db5a44",
"#447adb"
]
],
"line": {
"width": [
2,
3,
2,
3
],
"color": [
"red",
"green",
"blue",
"yellow"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A thing of beauty :)

]
}
},
"type": "bar"
}
]
],
"layout": {
"showlegend": true
Copy link
Contributor Author

@etpinard etpinard Jan 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which looked like

image

before 5d0d930

}
}