Skip to content

Commit e40e078

Browse files
piePattern : rework styleOne in case no colors defined
fixes bug (trace.marker.shape) & logic.
1 parent c24ae98 commit e40e078

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/traces/pie/style_one.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ module.exports = function styleOne(s, pt, trace, gd) {
2222
}
2323
// console.log( 's0 - i : ', s[0][0].__data__['i'], 'pt.color', pt.color, 'trace', trace);
2424

25-
if(!trace.marker.shape) trace.marker.color = pt.color;
25+
// enforce the point color, when colors (with s) & the pattern shape are missing.
26+
// 'abuse' the color attribute, used in the Drawing component for bar trace type.
27+
// alternative could be to pass the point color as an extra parameter in pointStyle
28+
if(!trace.marker.colors && !trace.marker.pattern.shape) trace.marker.color = pt.color;
2629

2730
Drawing.pointStyle(s, trace, gd);
2831
// to do : push into s.style d3 logic

0 commit comments

Comments
 (0)