繁体   English   中英

如何更改旭日图上环的颜色

[英]How to change the colors of rings on a sunburst Plotly chart

我目前正在尝试使用具有四个环的 Plotly 制作森伯斯特图表。 我希望前 3 个内环为浅蓝色,最外环为橙色。

我使用的代码是:

fig = px.sunburst(
    data,
    path=['column', 'column2','column3','column 4'],
    values='column4') 
fig.show()

非常感谢你的帮助!

设置标记的颜色应该做:

在 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM