当前位置: 首页 > Skill >

echarts

echarts

echarts

从 CSV、TSV、JSON 表格或现有配置中生成 Apache ECharts 配置 JSON、独立 HTML 图表页面及可导出的图表产物。使用...

1.0.1 2026.11.25 308
获取Skill文件查看使用说明
作 者:周景 许可证: 更新时间:2026.11.25
本文目录展开

ECharts

Build ECharts artifacts that are easy to preview, revise, export, and share in OpenClaw workspaces. Prefer saving actual files over leaving the chart design only in chat.

Workflow

  1. If the user already has an ECharts option object, refine it and run page.
  2. If the user has structured data in CSV, TSV, or JSON, run table.
  3. If the user only has a small inline list, run sample.
  4. If the user needs a static image, either add --export-image png|svg during build or run node {baseDir}/scripts/render-image.mjs --input <artifact-dir> --type png|svg afterward.

bun can be used anywhere below where node appears.

Quick Start

Quick line or bar chart from inline data:

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

Generate a chart from a CSV, TSV, or JSON table:

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

Build and export a PNG in one step:

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

Build and export both PNG and SVG in one run:

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

Package an existing option file into a standalone preview page:

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

Lint an option file before handing it off:

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

Export a static image from a generated artifact directory:

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

中文示例

销售趋势折线图:

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

值班热力图:

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

渠道转化桑基图:

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

股票 K 线:

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

团队协作关系图:

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

多指标平行坐标:

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

日历热力图:

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

时间流带图:

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

瀑布变化图:

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

南北区极坐标柱状图:

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

玫瑰饼图:

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

Artifacts

The builder writes a stable file set:

  • chart.spec.json: normalized build request and mappings
  • chart.option.json: ECharts config kept as the source of truth
  • chart.data.json: normalized input rows when source data was provided
  • chart.html: standalone preview and export page
  • manifest.json: small index of generated files and settings
  • optional exported image such as <fileBase>.png or <fileBase>.svg

Keep chart.option.json even when the user only asked for a preview page. It is the easiest artifact to diff, review, and reuse later. Static image exports can be created on demand with scripts/render-image.mjs or directly during build with one or more --export-image flags, and default to <fileBase>.png or <fileBase>.svg inside the artifact directory. manifest.json keeps single-image compatibility in files.image, and records multi-format exports in files.images.

Input Modes

sample

Best for quick drafts from short lists.

  • bar, line, area, polarBar: use --categories plus one or more --series Name:1,2,3
  • pictorialBar: use --categories plus one or more --series Name:1,2,3
  • pie: use --labels plus --values
  • rosePie: use --labels plus --values
  • funnel: use --labels plus --values
  • gauge: use --values, optional --labels, optional --maxes or shared --max-value
  • heatmap: use --x-categories, --y-categories, and --matrix
  • waterfall: use --categories and --values
  • calendar: use --dates and --values
  • themeRiver: use --dates plus one or more --series Name:1,2,3
  • candlestick: use --categories and --ohlc open,close,low,high;...
  • boxplot: use --categories and --boxes low,q1,median,q3,high;...
  • sankey: use repeated --link Source>Target:Value or a single --links list
  • graph: use repeated --link Source>Target:Value, with optional repeated --node Name[:Size[:Group]]
  • tree: use --labels, --values, and optional --parents
  • parallel: use --dimensions MetricA,MetricB,... plus one or more --series Name:1,2,3
  • radar: use --indicators plus one or more --series Name:1,2,3
  • treemap: use --labels, --values, and optional --parents
  • sunburst: use --labels, --values, and optional --parents

table

Best for real data files.

  • bar, line, area, polarBar: --x <field> and --y field1,field2
  • pictorialBar: --x <field> and --y field1,field2
  • pie: --label <field> and --value <field>
  • rosePie: --label <field> and --value <field>
  • funnel: --label <field> and --value <field>
  • gauge: --value <field> plus optional --label, --max-field, or shared --max-value
  • heatmap: --x <field> --y <field> --value <field>
  • waterfall: --x <field> --value <field>
  • calendar: --date <field> --value <field>
  • themeRiver: --date <field> --value <field> --series-field <field>
  • candlestick: --x <field> --open <field> --close <field> --low <field> --high <field>
  • boxplot: --x <field> --low <field> --q1 <field> --median <field> --q3 <field> --high <field>
  • sankey: --source <field> --target <field> --value <field>
  • graph: --source <field> --target <field> plus optional --value, --source-group, --target-group, --source-size, --target-size
  • tree: --label <field> --value <field> plus optional --parent-field
  • parallel: --name-field <field> --y metric1,metric2,metric3
  • scatter: --x <field> --y <field> plus optional --series-field, --size-field, --label-field
  • radar: --name-field <field> --y metric1,metric2,metric3
  • treemap: --label <field> --value <field> plus optional --parent-field
  • sunburst: --label <field> --value <field> plus optional --parent-field

page

Best when the option already exists and only needs a polished preview or export wrapper.

  • Accepts JSON option files
  • Preserves the option as JSON and wraps it in the standalone HTML template
  • Use --renderer svg when the final deliverable should stay vector-friendly

Export Guidance

  • Use --renderer svg for vector exports, design reviews, and docs-friendly embeds.
  • Use --renderer canvas for crisp PNG output and heavier charts.
  • Use --export-image png or --export-image svg during build.mjs for one-step image output.
  • Repeat --export-image to export multiple formats in one run, for example --export-image png --export-image svg.
  • Use node {baseDir}/scripts/render-image.mjs --input ./artifacts/chart-name --type png for direct PNG export.
  • Use node {baseDir}/scripts/render-image.mjs --input ./artifacts/chart-name --type svg for direct SVG export from SVG-rendered pages.
  • --export-image svg requires --renderer svg.
  • When exporting multiple formats, --image-out must point to a directory or a path without an extension.
  • render-image.mjs auto-detects Chrome or Edge. If detection fails, pass --browser-executable <path> or set ECHARTS_BROWSER_PATH.
  • chart.html still includes buttons for PNG download, SVG download when SVG renderer is active, JSON download, and clipboard copy.
  • The generated page first tries the configured CDN and then common public mirrors. If the environment is fully offline, rerun with --cdn <url> pointing to a local or mirrored bundle.

Authoring Rules

  • Choose the simplest chart that answers the question. Do not default to dashboards when one chart is enough.
  • Keep units in titles, axis names, or notes when the metric is ambiguous.
  • Use references/chart-selection.md when deciding between bars, pictorial bars, polar bars, lines, pies, rose pies, scatters, heatmaps, calendars, theme rivers, waterfalls, funnels, gauges, treemaps, sunbursts, candlesticks, boxplots, sankeys, graphs, trees, parallels, and radar charts.
  • Use references/option-patterns.md for JSON-safe option patterns such as data zoom, stacked series, donut layout, and mark lines.
  • Prefer JSON-safe config over formatter functions when possible. If function-based formatting is unavoidable, treat chart.option.json as the base and edit chart.html intentionally afterward.

OpenClaw And ClawHub Norms

  • Write artifacts inside the current workspace, not into home-directory scratch paths.
  • Keep examples, templates, and published artifacts generic. Sanitize client data before sharing anything on ClawHub.
  • Do not hide key logic in chat-only prose. Save the option, page, and normalized data as files.
  • Keep the skill reusable: data samples should be fake or clearly synthetic, and commands should use {baseDir} instead of machine-specific paths.

References

  • Read references/chart-selection.md for chart choice and data-shape guidance.
  • Read references/option-patterns.md for advanced JSON-safe option patterns and cleanup rules.

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,036
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,020
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,016
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
Skill 文件
  • SKILL.md
    • ECharts
    • Workflow
    • Quick Start
    • 中文示例
    • Artifacts
    • Input Modes
      • sample
      • table
      • page
    • Export Guidance
    • Authoring Rules
    • OpenClaw And ClawHub Norms
    • References
  • 项目或源文件

相关 Skill

更多
Apache Echarts Apache Echarts Apache ECharts 图表技能
图表生成工具 图表生成工具 MCP ECharts 基于 Apache ECharts,提供动态图表生成与数据分析,支持多导出格式及 MinIO 对象存储集成。
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。