返回顶部
e

echartsECharts图表生成

Create Apache ECharts option JSON, standalone HTML chart pages, and export-ready chart artifacts from CSV, TSV, JSON tables, or existing option configs. Use when a user asks for ECharts charts, dashboards, chart configs, preview pages, PNG or SVG-ready chart deliverables, or help turning structured data into practical ECharts visuals.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
142
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

echarts

ECharts

在 OpenClaw 工作空间中构建易于预览、修改、导出和分享的 ECharts 产物。优先保存实际文件,而非仅将图表设计留在对话中。

工作流程

  1. 1. 如果用户已有 ECharts 配置对象,优化它并运行 page。
  2. 如果用户有 CSV、TSV 或 JSON 格式的结构化数据,运行 table。
  3. 如果用户只有少量内联数据,运行 sample。
  4. 如果用户需要静态图片,可以在构建时添加 --export-image png|svg,或者之后运行 node {baseDir}/scripts/render-image.mjs --input --type png|svg。

以下所有出现 node 的地方都可以使用 bun 替代。

快速开始

从内联数据快速生成折线图或柱状图:

bash
node {baseDir}/scripts/build.mjs sample --chart line --categories Jan,Feb,Mar,Apr --series Revenue:120,160,210,260 --series Profit:24,30,42,51 --title Revenue and Profit --subtitle Sample series --out ./artifacts/revenue-profit

从 CSV、TSV 或 JSON 表格生成图表:

bash
node {baseDir}/scripts/build.mjs table --input ./data/sales.csv --chart bar --x month --y revenue,profit --title Monthly sales --page-mode report --out ./artifacts/monthly-sales

一步构建并导出 PNG:

bash
node {baseDir}/scripts/build.mjs sample --chart line --categories Jan,Feb,Mar,Apr --series Revenue:120,160,210,260 --title Quarterly trend --renderer svg --export-image png --out ./artifacts/quarterly-trend

一次运行同时导出 PNG 和 SVG:

bash
node {baseDir}/scripts/build.mjs sample --chart line --categories Jan,Feb,Mar,Apr --series Revenue:120,160,210,260 --title Quarterly trend --renderer svg --export-image png --export-image svg --out ./artifacts/quarterly-trend-both

将现有配置文件打包成独立预览页面:

bash
node {baseDir}/scripts/build.mjs page --option ./option.json --renderer svg --theme paper --title Release dashboard --out ./artifacts/release-dashboard

在交付前检查配置文件:

bash
node {baseDir}/scripts/lint-option.mjs ./artifacts/release-dashboard/chart.option.json

从生成的产物目录导出静态图片:

bash
node {baseDir}/scripts/render-image.mjs --input ./artifacts/monthly-sales --type png
node {baseDir}/scripts/render-image.mjs --input ./artifacts/release-dashboard --type svg

中文示例

销售趋势折线图:

bash
node {baseDir}/scripts/build.mjs sample --chart line --categories 1月,2月,3月,4月 --series 销售额:120,168,210,256 --series 毛利:32,45,58,73 --title 月度销售趋势 --subtitle 示例数据 --out ./artifacts/zh-sales-line

值班热力图:

bash
node {baseDir}/scripts/build.mjs sample --chart heatmap --x-categories 周一,周二,周三,周四,周五 --y-categories 上午,下午,晚上 --matrix 4,6,7,5,3;7,8,9,6,5;3,4,6,5,4 --title 客服值班热力图 --out ./artifacts/zh-heatmap

渠道转化桑基图:

bash
node {baseDir}/scripts/build.mjs sample --chart sankey --link 广告>注册:380 --link 自然流量>注册:240 --link 注册>激活:410 --link 激活>付费:126 --title 渠道转化流向 --out ./artifacts/zh-sankey

股票 K 线:

bash
node {baseDir}/scripts/build.mjs sample --chart candlestick --categories 周一,周二,周三,周四 --ohlc 12,15,11,16;15,14,13,17;14,18,13,19;18,17,16,20 --title 示例 K 线 --out ./artifacts/zh-candlestick

团队协作关系图:

bash
node {baseDir}/scripts/build.mjs sample --chart graph --link 产品>设计:8 --link 产品>前端:12 --link 前端>后端:10 --link 后端>运维:6 --node 产品:30:业务 --node 设计:24:设计 --node 前端:28:研发 --node 后端:28:研发 --node 运维:22:平台 --title 团队协作网络 --out ./artifacts/zh-graph

多指标平行坐标:

bash
node {baseDir}/scripts/build.mjs sample --chart parallel --dimensions 响应时间,稳定性,成本,易用性 --series 方案A:88,93,52,74 --series 方案B:72,85,66,91 --series 方案C:64,90,80,69 --title 方案对比 --out ./artifacts/zh-parallel

日历热力图:

bash
node {baseDir}/scripts/build.mjs sample --chart calendar --dates 2026-03-01,2026-03-02,2026-03-03,2026-03-04,2026-03-05,2026-03-06,2026-03-07 --values 12,18,9,20,16,24,14 --title 周活跃日历 --out ./artifacts/zh-calendar

时间流带图:

bash
node {baseDir}/scripts/build.mjs sample --chart themeRiver --dates 2026-03-01,2026-03-02,2026-03-03,2026-03-04 --series 广告:120,140,130,150 --series 自然流量:90,105,115,118 --series 转介绍:30,42,40,46 --title 渠道流量流带图 --out ./artifacts/zh-theme-river

瀑布变化图:

bash
node {baseDir}/scripts/build.mjs sample --chart waterfall --categories 新签,退款,扩容,流失 --values 120,-30,45,-10 --title 净变化瀑布图 --out ./artifacts/zh-waterfall

南北区极坐标柱状图:

bash
node {baseDir}/scripts/build.mjs sample --chart polarBar --categories 华北,华东,华南,西南 --series 营收:120,98,140,110 --title 区域营收极坐标图 --out ./artifacts/zh-polar-bar

玫瑰饼图:

bash
node {baseDir}/scripts/build.mjs sample --chart rosePie --labels 搜索,直接访问,社交,邮件 --values 420,310,180,90 --title 渠道结构玫瑰图 --out ./artifacts/zh-rose-pie

产物

构建器生成稳定的文件集:

  • - chart.spec.json:标准化的构建请求和映射
  • chart.option.json:作为真实数据源的 ECharts 配置
  • chart.data.json:提供源数据时的标准化输入行
  • chart.html:独立预览和导出页面
  • manifest.json:生成文件和设置的小型索引
  • 可选的导出图片,如 .png 或 .svg

即使用户只要求预览页面,也要保留 chart.option.json。它是日后最容易进行差异比较、审查和复用的产物。静态图片导出可以使用 scripts/render-image.mjs 按需创建,也可以在构建时通过一个或多个 --export-image 标志直接创建,默认保存在产物目录中的 .png 或 .svg。manifest.json 在 files.image 中保持单图片兼容性,并在 files.images 中记录多格式导出。

输入模式

sample

最适合从短列表快速生成草稿。

  • - bar、line、area、polarBar:使用 --categories 加上一个或多个 --series Name:1,2,3
  • pictorialBar:使用 --categories 加上一个或多个 --series Name:1,2,3
  • pie:使用 --labels 加上 --values
  • rosePie:使用 --labels 加上 --values
  • funnel:使用 --labels 加上 --values
  • gauge:使用 --values,可选的 --

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 echarts-1776026598 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 echarts-1776026598 技能

通过命令行安装

skillhub install echarts-1776026598

下载

⬇ 下载 echarts v1.0.1(免费)

文件大小: 38.04 KB | 发布时间: 2026-4-13 10:07

v1.0.1 最新 2026-4-13 10:07
**Adds in-build export option for static images.**

- You can now export PNG or SVG images directly during chart build with the `--export-image` flag.
- Multiple export images (e.g., PNG & SVG) can be created in a single build run.
- Documentation updated with examples for in-build image export and corresponding artifact changes.
- `manifest.json` now records single or multi-format image exports for better artifact tracking.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部