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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
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".
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 toknowledge/cache/<topic>.csvso it can be re-rendered.Render with matplotlib. Write the script to a file under
scratch/charts/<topic>.pyand execute it viashell_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) underknowledge/charts/<topic>.png.
Show and explain. In the assistant reply, link the saved image with a markdown image embed (
) 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.).Keep the script reproducible. The chart file is the artefact; the script under
scratch/charts/<topic>.pyis 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.
热度
- GitHub 星标
- 6.2k
- 排名
- #14390
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agentscope-java
6.2k帮你的智能体用 Java 编写非阻塞的 AgentScope 代码,AgentScope 是基于 Project Reactor 的多智能体框架。
data-report
6.2k帮你的智能体把数据集汇总成报告,包括平均值、总数、范围和趋势,并保存为 Markdown 文件。
data-transform
6.2k帮你的智能体在 CSV 和 JSON 等格式之间转换数据文件,使数据可以在其他工具中使用。
git-changelog
6.2k帮你的智能体根据 Git 历史编写变更日志或发布说明,并按新功能、修复和其他改动分组。