Skip to content

Commit b7f7537

Browse files
authored
Merge pull request #6629 from plotly/aggregated-pie-pattern-and-colors
Fix pattern colors of aggregated pie with patterns
2 parents f32c7ea + c0cf281 commit b7f7537

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

draftlogs/6601_add.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
- 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)],
1+
- 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)],
22
with thanks to @thierryVergult for the contribution!

src/components/drawing/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,8 @@ drawing.singlePointStyle = function(d, sel, trace, fns, gd, pt) {
753753
fgcolor = pt.color;
754754
perPointPattern = true;
755755
}
756-
var patternFGColor = drawing.getPatternAttr(fgcolor, d.i, null);
756+
var patternFGColor = drawing.getPatternAttr(fgcolor, d.i, (pt && pt.color) || null);
757+
757758
var patternBGColor = drawing.getPatternAttr(markerPattern.bgcolor, d.i, null);
758759
var patternFGOpacity = markerPattern.fgopacity;
759760
var patternSize = drawing.getPatternAttr(markerPattern.size, d.i, 8);
249 Bytes
Loading

test/image/mocks/pie_aggregated.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@
2626
"values": [
2727
10, 20, 30, 40, 50, 60, 70, 80
2828
],
29-
"marker": {"colors": ["", "", "#ccc"]},
29+
"marker": {
30+
"colors": ["", "", "#ccc"],
31+
"pattern": {
32+
"fillmode": "replace",
33+
"shape": ".",
34+
"size": 3
35+
}
36+
},
3037
"type": "pie",
3138
"domain": {"x": [0.5, 1]},
3239
"textinfo": "label+value+percent"

0 commit comments

Comments
 (0)