跳到正文
Skillpedia
分析与电子表格6.2k · #14390

chart-rendering

它能做什么

这项技能会根据问题选择合适的图表类型,并把它画成带有清晰标题和标签的图片。适合想用图像直观看到分析结果、而不是看一长串表格的人。

适用场景

  • ✓当你要求把一组数字画成图表或绘图时。
  • ✓当结果有很多行、用图片看更容易理解的时候。
  • ✓当你想看某个数值随时间如何变化时。

技能链接

https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-dataagent/src/main/resources/shared/agents/data-agent/skills/chart-rendering/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/agentscope-ai/agentscope-java/blob/main/agentscope-examples/agents/agentscope-dataagent/src/main/resources/shared/agents/data-agent/skills/chart-rendering/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把我们过去一年的每月注册人数画成折线图,加上清晰的标题和坐标轴标签。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能先把问题匹配到图表类型,例如变化趋势用折线图,比较类别用柱状图。然后它会编写一个简短脚本来绘制图表,并把图片和脚本一起保存。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Chart Rendering Skill

Repeatable SOP for turning a result set into a chart that actually communicates the point.

Steps

  1. Match chart type to question. Decide before drawing:

    Question shape Chart
    "How does X change over time?" Line (single series) or multi-line
    "Composition / share of total" Stacked bar, or 100% stacked area
    "Comparison across a small set of categories" Bar (horizontal if labels are long)
    "Relationship between two numeric variables" Scatter
    "Distribution of a single variable" Histogram or box plot
    "Cumulative total" Area

    If none fit, ask the user which view they want — do not default to "any chart will do".

  2. Prepare the data. The query result from the [[sql-analysis]] Skill should already be tidy (one row per data point, one column per dimension). If not, reshape first using pandas (pivot, melt, groupby). Save the cleaned frame to knowledge/cache/<topic>.csv so it can be re-rendered.

  3. Render with matplotlib. Write the script to a file under scratch/charts/<topic>.py and execute it via shell_run. Conventions:

    • Title — one sentence answering the question (not "Untitled chart").
    • Axes — label both, include units (Active users (count), Date (UTC)).
    • Legend — include only if there is more than one series.
    • Colours — use the matplotlib default palette unless the user has a stated brand colour in knowledge/style.md.
    • Output — save as PNG (bbox_inches='tight', dpi=150) under knowledge/charts/<topic>.png.
  4. Show and explain. In the assistant reply, link the saved image with a markdown image embed (![title](knowledge/charts/<topic>.png)) and write 2–3 sentences interpreting it — what the chart shows, the one thing the user should take away, and any caveat (incomplete latest data point, outliers excluded, etc.).

  5. Keep the script reproducible. The chart file is the artefact; the script under scratch/charts/<topic>.py is the source of truth. If the user asks for a tweak ("can we use a log y-axis?"), edit the script and re-run — do not regenerate from scratch.

Anti-patterns

  • ❌ Pie charts with > 5 slices.
  • ❌ Charting raw counts when proportions are what the user actually asked.
  • ❌ A chart whose axes have no labels or unit.
  • ❌ Embedding the image without 2 sentences of interpretation.

When to delegate

If the user wants a multi-chart dashboard with narrative around it (e.g. "build me a weekly product health deck"), spawn the report-writer sub-agent — this Skill is for individual charts.

常见问题

它使用哪些图表类型?

根据问题不同,它可以使用折线图、堆叠柱状图、柱状图、散点图、直方图、箱线图和面积图。

我会得到什么?

你会得到一个图片文件,以及生成它的脚本。

如果没有合适的图表类型怎么办?

技能会询问你想要哪种视图,而不是随意猜测。

详情

作者的原始描述

Visualise the result of an analysis as a chart (line, bar, area, scatter, etc.). Use when the user asks to "plot...", "chart...", "show me the trend of...", "visualise...", or when a numerical result has more than ~10 rows and would be easier to read as a picture. Produces an image file plus the script that generated it.

repo: agentscope-ai/agentscope-java

热度

GitHub 星标
6.2k
排名
#14390
许可证
Apache-2.0
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能