npx skills add ...
npx skills add starchild-ai-agent/official-skills --skill chart
Interactive web charts: line, bar, candle, scatter, with HTML and screenshot output.
npx skills add starchild-ai-agent/official-skills --skill chart
Generate interactive chart pages with Apache ECharts. Each chart lives in a dedicated project folder under output/chart-html/, making it easy to reuse and iterate.
Any time the user wants a visual chart: price charts, comparisons, dashboards, business analytics, etc.
getDataURL) + canvas merge for reliable PNG outputEach chart project should follow:
Example folder name: btc-90d-20260401
Available templates:
| Template | Best for |
|---|---|
line.html | Time-series trends, multi-series comparisons |
bar.html | Category comparisons, rankings |
pie.html | Composition / share breakdown |
candlestick.html | OHLCV price charts |
scatter.html | Correlation, distribution |
dashboard.html | KPI cards + 2×2 multi-chart grid |
radar.html | Multi-dimension scoring |
heatmap.html | Matrix / calendar intensity |
dual-axis.html | Two series with very different scales (e.g. market cap vs stablecoin supply) — left and right Y axes, each with its own label color |
multi-panel.html | Stacked panels sharing one X axis (e.g. price + volume + RSI) — single ECharts instance, tooltip/zoom synced across all panels |
waterfall.html | Incremental contribution breakdown (e.g. P&L attribution, budget variance) — positive/negative bars stacked on a floating base |
Use create_project(name, description, data_sources) from scripts/build_chart.py.
Use either:
build_chart(template_name, ...)build_chart_custom(...)Then save as index.html in the project folder:
save_chart(html, project_dir=project_dir)Also save:
save_generate_script(script_content, project_dir) → generate.pysave_data(data, project_dir) → data.jsoncreate_project(...)Use project-root serving (recommended):
Then open: /preview/<id>/<project-name>/index.html
Important behavior in v3.0.1:
chart_server.py now rewrites preview-prefixed static paths internally (/preview/<id>/... → /...) before filesystem lookup.index.html instead of falling back to root directory listing.output/chart-html/<project>/index.html (do not serve output/chart-html directly as a static preview without chart_server.py).Two modes:
screenshot.pngscreenshot_chart(project_dir) (Playwright) and send screenshot.png directlyEvery chart page must include these buttons:
Do not include gallery entry.
| File | Purpose |
|---|---|
skills/chart/scripts/base-styles.css | Base dark theme CSS |
skills/chart/scripts/base-export.js | Export helpers: download/copy/save-to-project |
skills/chart/scripts/build_chart.py | Project creation, HTML build, data/script save, screenshot |
skills/chart/scripts/chart_server.py | Static server + /save-chart API |
skills/chart/templates/*.html | Reusable chart templates |
output/chart-html/<project>/* | All generated chart artifacts |
const DATA = ...) to avoid iframe CORS issues.window.CHART_INSTANCES.topic-range-date) for easy lookup.<div class="actions">
<button onclick="downloadPNG(this)">📥 Download PNG</button>
<button onclick="copyToClipboard(this)">📋 Copy Image</button>
<button onclick="saveToProject(this)">💾 Save Image</button>
</div>