diff --git a/draftlogs/6601_add.md b/draftlogs/6601_add.md index 1d84b7fd300..54127d1b7d9 100644 --- a/draftlogs/6601_add.md +++ b/draftlogs/6601_add.md @@ -1,2 +1,2 @@ -- add pattern to pie, funnelarea, sunburst, icicle and treemap traces [[#6601](https://github.com/plotly/plotly.js/pull/6601), [#6619](https://github.com/plotly/plotly.js/pull/6619), [#6622](https://github.com/plotly/plotly.js/pull/6622), [#6626](https://github.com/plotly/plotly.js/pull/6626), [#6627](https://github.com/plotly/plotly.js/pull/6627) [#6628](https://github.com/plotly/plotly.js/pull/6628)], +- add pattern to pie, funnelarea, sunburst, icicle and treemap traces [[#6601](https://github.com/plotly/plotly.js/pull/6601), [#6619](https://github.com/plotly/plotly.js/pull/6619), [#6622](https://github.com/plotly/plotly.js/pull/6622), [#6626](https://github.com/plotly/plotly.js/pull/6626), [#6627](https://github.com/plotly/plotly.js/pull/6627, [#6628](https://github.com/plotly/plotly.js/pull/6628), [#6629](https://github.com/plotly/plotly.js/pull/6629)], with thanks to @thierryVergult for the contribution! diff --git a/src/components/drawing/index.js b/src/components/drawing/index.js index 7e4e81142e6..fb1724489c6 100644 --- a/src/components/drawing/index.js +++ b/src/components/drawing/index.js @@ -753,7 +753,8 @@ drawing.singlePointStyle = function(d, sel, trace, fns, gd, pt) { fgcolor = pt.color; perPointPattern = true; } - var patternFGColor = drawing.getPatternAttr(fgcolor, d.i, null); + var patternFGColor = drawing.getPatternAttr(fgcolor, d.i, (pt && pt.color) || null); + var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, d.i, null); var patternFGOpacity = markerPattern.fgopacity; var patternSize = drawing.getPatternAttr(markerPattern.size, d.i, 8); diff --git a/test/image/baselines/pie_aggregated.png b/test/image/baselines/pie_aggregated.png index 6ac30a52f2f..84ca2783621 100644 Binary files a/test/image/baselines/pie_aggregated.png and b/test/image/baselines/pie_aggregated.png differ diff --git a/test/image/mocks/pie_aggregated.json b/test/image/mocks/pie_aggregated.json index 9740acecae2..1e8953b36d8 100644 --- a/test/image/mocks/pie_aggregated.json +++ b/test/image/mocks/pie_aggregated.json @@ -26,7 +26,14 @@ "values": [ 10, 20, 30, 40, 50, 60, 70, 80 ], - "marker": {"colors": ["", "", "#ccc"]}, + "marker": { + "colors": ["", "", "#ccc"], + "pattern": { + "fillmode": "replace", + "shape": ".", + "size": 3 + } + }, "type": "pie", "domain": {"x": [0.5, 1]}, "textinfo": "label+value+percent"