Skip to content

Commit

Permalink
Merge pull request #6629 from plotly/aggregated-pie-pattern-and-colors
Browse files Browse the repository at this point in the history
Fix pattern colors of aggregated pie with patterns
  • Loading branch information
archmoj committed Jun 6, 2023
2 parents f32c7ea + c0cf281 commit b7f7537
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion draftlogs/6601_add.md
Original file line number Diff line number Diff line change
@@ -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!
3 changes: 2 additions & 1 deletion src/components/drawing/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Binary file modified test/image/baselines/pie_aggregated.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion test/image/mocks/pie_aggregated.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b7f7537

Please sign in to comment.