[英]How to change the colors of rings on a sunburst Plotly chart
Im currently trying to make a sunburst chart with Plotly that has four rings.我目前正在尝试使用具有四个环的 Plotly 制作森伯斯特图表。 I would like the first 3 inner rings to be light blue and the outer most ring to be orange.
我希望前 3 个内环为浅蓝色,最外环为橙色。
The code I used is:我使用的代码是:
fig = px.sunburst(
data,
path=['column', 'column2','column3','column 4'],
values='column4')
fig.show()
Thank you so much for your help!非常感谢你的帮助!
Setting the colors of the marker should do:设置标记的颜色应该做:
In javascript :在 JavaScript 中:
data = [{
type: "sunburst",
labels: ["ring1", "ring2", "ring3", "ring4"],
parents: ["", "ring1", "ring2", "ring3"],
marker: {
colors: [ "steelblue","steelblue","steelblue", "orange"]
},
}];
Plotly.newPlot('plotlyDiv1', data);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.