chart-gen

Solid

从JSON数据生成高质量PNG/SVG图表图片,支持折线图、柱状图、面积图、散点图、K线图、饼图/环形图、热力图、多系列图和堆叠图等多种类型。适用于快速可视化数据、生成报告图表、绘制趋势变化等场景。当用户请求“生成图表”、“画个趋势图”、“做个柱状图”、“可视化这些数据”,或提供具体数据并要求“做成图表图片”、“导出为PNG”时触发。

AI & Automation 4 stars 1 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
23
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

<!-- Localized from: chart-image --> # 图表图片生成器 使用 Vega-Lite 从数据生成 PNG 图表图片,非常适合无界面的服务器环境。 ## 为什么选择这个 Skill? **专为 Fly.io / VPS / Docker 部署而设计:** - ✅ **无需原生编译** - 使用 Sharp 预编译二进制文件(不像 `canvas` 需要构建工具) - ✅ **无需 Puppeteer/浏览器** - 纯 Node.js 实现,无需下载 Chrome,无需无头浏览器开销 - ✅ **轻量级** - 总依赖约 15MB,而基于 Puppeteer 的方案需要 400MB+ - ✅ **冷启动快** - 无需等待浏览器启动,图表生成耗时 <500ms - ✅ **支持离线** - 无需任何外部 API 调用(不像 QuickChart.io) ## 安装(仅需一次) ```bash cd /data/clawd/skills/chart-image/scripts && npm install ``` ## 快速上手 ```bash node /data/clawd/skills/chart-image/scripts/chart.mjs \ --type line \ --data '[{"x":"10:00","y":25},{"x":"10:30","y":27},{"x":"11:00","y":31}]' \ --title "Price Over Time" \ --output chart.png ``` ## 图表类型 ### 折线图(默认) ```bash node chart.mjs --type line --data '[{"x":"A","y":10},{"x":"B","y":15}]' --output line.png ``` ### 柱状图 ```bash node chart.mjs --type bar --data '[{"x":"A","y":10},{"x":"B","y":15}]' --output bar.png ``` ### 面积图 ```bash node chart.mjs --type area --data '[{"x":"A","y":10},{"x":"B","y":15}]' --output area.png ``` ### 饼图 / 环形图 ```bash # 饼图 node chart.mjs --type pie --data '[{"category":"A","value":30},{"category":"B","value":70}]' \ --category-field category --y-field value --output pie.png # 环形图(中间有空洞) node chart.mjs --type donut --data '[{"category":"A","value":30},{"category":"B","value":70}]' \ --category-field category --y-field value --output donut.png ``` ### K 线图(OHLC) ```bash node chart.mjs --type candlestick \ --data '[{"x":"Mon","open...

Details

Author
serejaris
Repository
serejaris/kimi-skills
Created
1 weeks ago
Last Updated
1 weeks ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category