Skip to content

Commit 861b066

Browse files
committed
colorway
1 parent ae6221d commit 861b066

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/python/plotly/plotly/express/_chart_types.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,8 +1139,13 @@ def pie(
11391139
"""
11401140
In a pie plot, each row of `data_frame` is represented as a sector of a pie.
11411141
"""
1142+
if color_discrete_sequence is not None:
1143+
layout_patch = {"piecolorway": color_discrete_sequence}
11421144
return make_figure(
1143-
args=locals(), constructor=go.Pie, trace_patch=dict(showlegend=True, hole=hole)
1145+
args=locals(),
1146+
constructor=go.Pie,
1147+
trace_patch=dict(showlegend=True, hole=hole),
1148+
layout_patch=layout_patch,
11441149
)
11451150

11461151

@@ -1184,10 +1189,13 @@ def sunburst(
11841189
A sunburst plot represents hierarchial data as sectors laid out over
11851190
several levels of concentric rings.
11861191
"""
1192+
if color_discrete_sequence is not None:
1193+
layout_patch = {"sunburstcolorway": color_discrete_sequence}
11871194
return make_figure(
11881195
args=locals(),
11891196
constructor=go.Sunburst,
11901197
trace_patch=dict(branchvalues=branchvalues, maxdepth=maxdepth),
1198+
layout_patch=layout_patch,
11911199
)
11921200

11931201

@@ -1220,10 +1228,13 @@ def treemap(
12201228
"""
12211229
A treemap plot represents hierarchial data as nested rectangular sectors.
12221230
"""
1231+
if color_discrete_sequence is not None:
1232+
layout_patch = {"treemapcolorway": color_discrete_sequence}
12231233
return make_figure(
12241234
args=locals(),
12251235
constructor=go.Treemap,
12261236
trace_patch=dict(branchvalues=branchvalues, maxdepth=maxdepth),
1237+
layout_patch=layout_patch,
12271238
)
12281239

12291240

0 commit comments

Comments
 (0)