ZyVOP Logo
Content That Connects
SeriesAI NewsWhy ZyVOPJoin Discord
ZyVOP Logo
Content That Connects

Empowering developers and creators with cutting-edge insights, comprehensive tutorials, and innovative solutions for the digital future.

Content

  • Categories
  • Tags
  • Badges
  • Leaderboard
  • Write Article
  • Newsletter

Company

  • About Us
  • Why ZyVOP
  • API Documentation
  • Write for Us
  • Contact

Connect

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DMCA Policy
  • Code of Conduct

© 2026 ZyVOP. Crafted with care for the developer community.

Made with ❤️ by the ZyVOP team
All systems operational
HomeCreating Sunburst Charts with AI, Plotly, Python, Notion, or Feishu

Creating Sunburst Charts with AI, Plotly, Python, Notion, or Feishu

I0veD
I0veDcyber security researcher
August 12, 2026
2 min read
Creating Sunburst Charts with AI, Plotly, Python, Notion, or Feishu
Article

To create and share charts through Plotly's Chart Studio (web version), you can follow these steps:

1. Log in or register for Plotly Chart Studio

  1. OpenPlotly Chart Studio.

  1. If you don’t have an account, click “Sign Up” to register; if you already have an account, click “Log In” to log in.

2. Create a chart

  1. After logging in, click the "Create" button in the upper right corner of the page.

  1. Select "Chart" to create a new chart.

3. Upload data

  1. On the chart creation page that opens, you can choose to upload a data file (such as CSV) or enter the data directly.

  1. Click "Add Trace" and select "Type of Chart" as "Sunburst".

4. Configure charts

  1. In the "Data" tab, configure the data source. For a sunburst chart, you need to configure the "Labels" and "Parents" fields.

  1. In the Traces tab, select specific settings for the sunburst chart, such as color and hierarchy.

5. Save the chart

  1. After the configuration is completed, click the "Save" button in the upper right corner of the page.

  1. Enter a chart name and description, then click Save.

6. Generate embed code

  1. After saving the chart, click the "Share" button in the upper right corner of the page.

  1. In the pop-up menu, select the "Embed" option.

  1. Copy the generated embed code.

7. Embed charts into Notion

  1. Open Notion and navigate to the page where you want to insert the chart.

  1. Create an "Embed" block:

  1. In the dialog box that pops up, paste the embed code you copied from Plotly Chart Studio and click "Embed".

Through the above steps, you can embed an interactive sunburst chart in your Notion page. Doing so allows you to display and interact with chart content directly in Notion.

Sample code (generated in Python and uploaded to Plotly)

The following is a complete code example for generating a sunburst chart in Python and uploading it to Plotly Chart Studio:

python复制代码
import plotly.graph_objects as go
import chart_studio
import chart_studio.plotly as py
import chart_studio.tools as tls

输入您的Plotly账户信息

username = 'your_username'
api_key = 'your_api_key'

chart_studio.tools.set_credentials_file(username=username, api_key=api_key)

构建层次结构数据

data = {
"name": "云计算平台",
"children": [
{
"name": "AWS",
"children": [
{
"name": "容器技术",
"children": [
{
"name": "Kubernetes",
"children": [
{
"name": "攻击面",
"children": [
{"name": "AKSK攻击"},
{"name": "Kubernetes攻击"},
{"name": "CI/CD攻击"},
{"name": "Docker Swarm攻击"},
{"name": "eBPF攻击"}
]
},
{
"name": "防御措施",
"children": [
{"name": "网络隔离"},
{"name": "密钥防御"},
{"name": "Severless防护"},
{"name": "IAC扫描"},
{"name": "容器扫描"}
]
},
{
"name": "BAS平台",
"children": [
{"name": "虚拟攻击"},
{"name": "入侵"},
{"name": "服务器区攻击"},
{"name": "横向移动"},
{"name": "数据泄露"},
{"name": "攻击路线模拟"}
]
}
]
}
]
}
]
}
]
}

将层次结构数据转换为适合Plotly的数据格式

def get_sunburst_data(node, parent_name=""):
labels = []
parents = []
ids = []

def recurse(node, parent_name):
    name = node["name"]
    labels.append(name)
    parents.append(parent_name)
    ids.append(name)
    for child in node.get("children", []):
        recurse(child, name)

recurse(node, parent_name)
return labels, parents, ids

labels, parents, ids = get_sunburst_data(data)

绘制旭日图

fig = go.Figure(go.Sunburst(
labels=labels,
parents=parents,
ids=ids,
))

上传图表到Plotly Chart Studio

py.plot(fig, filename='Sunburst Chart', auto_open=True)

I0veD

I0veD

cyber security researcher

Cloud Native & AI Sec Researcher Red Team | BAS | K8s | Evasion 20+ CVEs | CNVD/CNNVD Contributor 🛡️ AI-Driven Blue Team 👇 Works

Comments (0)

Login to post a comment.