← Back to Skills Marketplace
openlark

Apache Echarts

by OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
113
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install apache-echarts
Description
Apache ECharts charting skill.
README (SKILL.md)

ECharts Skill

Generate high-quality interactive visual HTML chart pages based on user-provided two-dimensional data or time series data. Automatically select the most appropriate chart type, supporting 20+ chart types including bar charts, line charts, pie charts, scatter plots, maps, etc. Supports one-click PNG image export.

Trigger Scenarios

  • Draw a chart
  • Generate a chart
  • Use ECharts
  • Visualize data
  • Plot the data

Workflow

  1. Analyze Data: Identify data type (categorical/time series/numeric/geographic)
  2. Select Chart: Recommend the most suitable chart type based on data structure
  3. Generate HTML: Generate a complete interactive HTML file based on ECharts 5.x CDN

CDN Import

Always use ECharts 5.x CDN (no download required):

\x3Cscript src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js">\x3C/script>

Standard HTML Template

The generated HTML contains a chart rendering area.

\x3C!DOCTYPE html>
\x3Chtml lang="en">
\x3Chead>
  \x3Cmeta charset="UTF-8">
  \x3Cmeta name="viewport" content="width=device-width, initial-scale=1.0">
  \x3Ctitle>Chart Title\x3C/title>
  \x3Cscript src="https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js">\x3C/script>
  \x3Cstyle>
    body { font-family: -apple-system, sans-serif; padding: 24px; background: #f0f2f5; }
    .container { max-width: 1200px; margin: 0 auto; }
    .chart-title { text-align: center; font-size: 22px; font-weight: 600; color: #1f2329; margin-bottom: 16px; }
    #chart { width: 100%; height: 480px; background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
    .toast {
      position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
      padding: 10px 20px; background: rgba(30,35,41,0.9); color: #fff;
      border-radius: 8px; font-size: 14px; pointer-events: none;
      opacity: 0; transition: opacity 0.3s; z-index: 9999;
    }
    .toast.show { opacity: 1; }
  \x3C/style>
\x3C/head>
\x3Cbody>
  \x3Cdiv class="container">
    \x3Cdiv class="chart-title">Chart Title\x3C/div>
    \x3Cdiv id="chart">\x3C/div>
  \x3C/div>
  \x3Cdiv class="toast" id="toast">\x3C/div>
  \x3Cscript>
    var chart = echarts.init(document.getElementById('chart'));
    var option = {
      // ... user's chart configuration ...
      // === Export tool (appended directly to option) ===
      toolbox: {
        right: 16,
        top: 0,
        feature: {
          saveAsImage: {
            type: 'png',
            pixelRatio: 2,       // 2=high definition, can be set to 3 for ultra HD
            title: 'Export PNG Image',
            name: 'chart'        // Download file name
          }
        }
      }
    };
    chart.setOption(option);
    window.addEventListener('resize', function() { chart.resize(); });

    // Listen for export completion event, show toast notification
    chart.on('download', function() {
      var t = document.getElementById('toast');
      t.textContent = 'Image saved'; t.classList.add('show');
      setTimeout(function() { t.classList.remove('show'); }, 2000);
    });
  \x3C/script>
\x3C/body>
\x3C/html>

Chart Type Selection

Data Scenario Recommended Chart series.type
Compare categorical data Bar chart bar
Trends over time Line chart line
Part-to-whole proportion Pie chart pie
Relationship between two variables Scatter plot scatter
Multi-series trend comparison Multi-line chart line
Geographic distribution Map map
Distribution density Heatmap heatmap
Level/progress Gauge gauge
Relationships/flows Sankey/Radar sankey / radar
Mixed scenarios Combo chart multiple series

Core Configuration

var option = {
  title: { text: 'Title', subtext: 'Subtitle', left: 'center' },
  tooltip: { trigger: 'axis' },
  legend: { data: ['Series Name'], top: 30 },
  grid: { left: '10%', right: '10%', bottom: '15%', containLabel: true },
  xAxis: { type: 'category', data: ['x-axis data'] },
  yAxis: { type: 'value' },
  series: [{ name: 'Sales', type: 'bar', data: [5, 20, 36] }]
};

Complete Examples for Common Charts

Bar Chart

xAxis: { type: 'category', data: ['Shirts','Sweaters','Chiffon','Pants','Heels','Socks'] },
yAxis: { type: 'value' },
series: [{ name: 'Sales', type: 'bar', data: [5, 20, 36, 10, 10, 20] }]

Line Chart

xAxis: { type: 'category', data: ['Jan','Feb','Mar','Apr','May'], boundaryGap: false },
series: [
  { name: 'Revenue', type: 'line', data: [12, 25, 18, 30, 42], smooth: true },
  { name: 'Expenses', type: 'line', data: [8, 15, 12, 20, 28], smooth: true }
]

Pie Chart

series: [{
  type: 'pie', radius: '55%',
  data: [
    { value: 335, name: 'Direct Visit' },
    { value: 310, name: 'Email Marketing' },
    { value: 234, name: 'Affiliate Ads' },
    { value: 135, name: 'Search Engine' }
  ],
  label: { show: true, formatter: '{b}: {d}%' }
}]

Scatter Plot

xAxis: { type: 'value', name: 'Height (cm)' },
yAxis: { type: 'value', name: 'Weight (kg)' },
series: [{ type: 'scatter', symbolSize: 12, data: [[172,68],[168,62],[177,75],[159,55],[180,82]] }]

Export Functionality (toolbox.saveAsImage)

ECharts has built-in export capability. Simply add the following configuration to your option to see the export icon in the top-right corner of the chart:

toolbox: {
  right: 16,   // Distance from right edge
  top: 0,      // Distance from top edge
  feature: {
    saveAsImage: {
      type: 'png',       // or 'jpeg'
      pixelRatio: 2,     // Pixel density: 1=standard 2=high definition 3=ultra high
      title: 'Export PNG Image',
      name: 'chart'      // Download file name (without extension)
    }
  }
}

Show a notification after export:

chart.on('download', function() {
  // Show Toast "Image saved"
});

Console API:

window.__echarts_export__.getPngUrl(2);   // Get PNG dataURL
window.__echarts_export__.resize();       // Trigger redraw

Style Themes

echarts.init(dom, 'dark');   // Dark theme
echarts.init(dom, 'light'); // Light theme (default)

Custom color palette: color: ['#5470C6','#91CC75','#FAC858','#EE6666','#73C0DE','#3BA272','#FC8452','#9A60B4']

Output File

Generate a complete .html file, save it to the workspace, including:

  • ECharts 5.x CDN import (no local files required)
  • Built-in export icon in the top-right corner of the chart (toolbox.saveAsImage)
  • Toast notification after export completion
  • Responsive resizing (window.resize)
  • window.__echarts_export__ console API

For detailed API and examples, see references/api.md

Usage Guidance
This skill appears to do what it says: produce interactive HTML pages using ECharts from a CDN. Before installing or using it, consider the following: (1) CDN trust — the HTML loads echarts from jsDelivr; if you require stronger supply-chain guarantees, host a vetted copy or use an organization-approved CDN. (2) XSS/serialization — ensure any chart option or user data is serialized safely (use JSON.stringify when embedding OPTION) so strings can't inject arbitrary script into the generated HTML. (3) Exposed API — the template exposes window.__echarts_export__ (getPngUrl) which can be convenient but means any script on the page can read the generated image data; avoid hosting the generated pages where untrusted third-party scripts run. (4) If you plan to embed sensitive data in charts, review how the agent substitutes values into the template and confirm no external endpoints are contacted. If you want higher assurance, ask the publisher for explicit details on how OPTION is serialized and/or request a version that safely JSON-encodes embedded data.
Capability Analysis
Type: OpenClaw Skill Name: apache-echarts Version: 1.0.0 The apache-echarts skill is a legitimate utility designed to generate interactive data visualizations using the Apache ECharts library. It provides well-structured instructions in SKILL.md and a clean HTML template in assets/template.html that utilizes a reputable CDN (jsDelivr). There are no indicators of data exfiltration, malicious code execution, or harmful prompt injection; the skill functions exactly as described by facilitating the creation of chart-based HTML files within the user's workspace.
Capability Assessment
Purpose & Capability
Name and description (Apache ECharts charting) align with the provided artifacts: an SKILL.md describing chart generation, an API reference, and an HTML template that imports ECharts from a public CDN. It requests no unrelated binaries, env vars, or config paths.
Instruction Scope
Instructions stay within chart-generation scope and explicitly instruct using the ECharts CDN and producing a complete HTML page. Two points to watch: (1) the template injects a raw {{OPTION}} JavaScript object into the page — if the OPTION content is not safely JSON-serialized/escaped there is a risk of HTML/JS injection (XSS) if any input contains malicious strings; (2) the generated page defines window.__echarts_export__ with getPngUrl() returning a data URL — this is useful but also exposes an API that could be abused by other scripts on the same page to read exported data.
Install Mechanism
Instruction-only skill with no install spec and no download actions. Uses a public CDN (jsDelivr) to load echarts, which is standard for client-side charting. No archives or arbitrary code downloads are requested.
Credentials
No environment variables, credentials, or sensitive config paths are requested. The skill does not ask for unrelated secrets or system access.
Persistence & Privilege
always is false and the skill is user-invocable. No installation actions modify other skills or system-wide settings. Autonomous invocation is allowed (platform default) but is not combined with other red flags here.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install apache-echarts
  3. After installation, invoke the skill by name or use /apache-echarts
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the Apache ECharts charting skill: - Generate interactive HTML charts from user-provided 2D or time series data using ECharts 5.x CDN. - Supports automatic chart type selection (20+ types: bar, line, pie, scatter, map, etc.). - Every chart includes a built-in PNG export tool with toast notification after export. - Output is a full HTML file with mobile-friendly layout and high-quality visuals. - Includes quick-start examples and standard ECharts configuration patterns for common scenarios.
Metadata
Slug apache-echarts
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Apache Echarts?

Apache ECharts charting skill. It is an AI Agent Skill for Claude Code / OpenClaw, with 113 downloads so far.

How do I install Apache Echarts?

Run "/install apache-echarts" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Apache Echarts free?

Yes, Apache Echarts is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Apache Echarts support?

Apache Echarts is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Apache Echarts?

It is built and maintained by OpenLark (@openlark); the current version is v1.0.0.

💬 Comments