graphic-chart
БесплатноЗапускает вложенные скриптыНе проверенGenerates data visualization charts (bar, line, area, pie, doughnut, scatter, radar, treemap) as PNG using Apache ECharts v6. 1080×1080px default, 5 style…
от Varnan-Tech★ 724 звезды на GitHubОб этом скилле
graphic-chart
Generates data visualization charts as PNG. Renders HTML with Apache ECharts v6 in headless Chromium via Playwright → screenshots at 2× retina quality.
CDN: https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js
Critical Rules (read before every generation)
areatype →type: 'line'+areaStyle: {}— ECharts has notype: 'area'.doughnut→type: 'pie'+radius: ['40%', '70%']— ECharts has notype: 'doughnut'.- Readiness signal: register
chart.on('finished', fn)BEFOREchart.setOption()— ECharts bug #14101/#17500: if listener is registered after setOption, it silently never fires. Always register bothfinishedandrenderedevents before setOption. xAxis.type: 'category'must be explicit — ECharts does not infer it from the data. Forgetting this produces a blank chart.- Category labels go in
xAxis.data, not in adata.labelsarray. ECharts structure is flat:{ xAxis, yAxis, series, grid, title, legend }— not nested underdataoroptions. - Data labels are fully built-in — use
label: { show: true }on any series. No plugin needed. - Highlight a specific bar/point via per-item
itemStyle— put{ value: N, itemStyle: { color: '#...' } }directly in thedataarray. Do NOT use Chart.js-stylebackgroundColorarrays. - ECharts init uses a
<div>container, not<canvas>—echarts.init(document.getElementById('chart')). The container div needs explicit dimensions. animation: falsein option — disables animation for instant render. Still registerfinished+renderedevents before setOption for the readiness signal.- Never dump HTML in chat. Save to file, show summary only.
- Title states the insight, not the subject. "Revenue grew 3× in 12 months" not "Monthly Revenue".
- Pie/doughnut: use body
padding: 64px 80pxand.chart-container { max-height: 860px }— prevents edge-to-edge fill when no title.
Step 1: Intake
Required: chart_type, data
Optional parameters and defaults:
| Parameter | Default | Description |
|---|---|---|
| chart_type | — | bar / line / area / pie / doughnut / scatter / radar / treemap |
| data | — | JSON array or CSV — required |
| title | — | States the insight, ≤10 words |
| subtitle | — | 1-sentence context line |
| style | clean-slate | clean-slate / midnight-editorial / matt-gray / electric-burst / brutalist |
| dimensions | 1080x1080 | WxH pixels (output PNG = 2× via deviceScaleFactor) |
| x_label | — | X-axis label text |
| y_label | — | Y-axis label text |
| source | — | Data source shown in footer |
| highlight | — | Data label to highlight (e.g. "Q4", "Dec", index 3) |
If chart_type or data is missing, ask exactly:
"To create the chart, I need:
- Chart type — bar / line / area / pie / doughnut / scatter / radar / treemap
- Data — provide as JSON array or CSV (e.g.
[12, 18, 22, 25, 31]with labels['Q1','Q2','Q3','Q4','Q5'])Optional: title, style (default: clean-slate), dimensions (default: 1080×1080), highlight a specific data point"
If both present → skip to Step 2.
Step 2: Internal Architecture (never shown to user)
1. Normalize chart type:
area→line+areaStyle: {}on seriesdoughnut→pie+radius: ['40%', '70%']on serieshorizontal bar→bar+ swap xAxis/yAxis (category axis on y)- All others: use as-is
2. Read references/chart-library.md — load full config spec for this chart type.
3. Read references/style-presets.md — load CSS tokens + data palette for chosen style.
4. Commit to design direction:
| Decision | Derive from |
|---|---|
| Tone | Professional / editorial / bold / technical — match the data's audience |
| Data story | Single insight this chart proves (becomes the title) |
| Highlight strategy | Which data point needs visual emphasis and why? |
| Background | Light (clean-slate, matt-gray) or dark (midnight-editorial, electric-burst, brutalist) |
5. Parse data:
- Simple array
[12, 18, 22]→ series.data, labels provided separately - Object array
[{x: 'Jan', y: 12}]→ xAxis.data from x keys, series.data from y values - CSV: parse header row as xAxis.data, value row as series.data
- Multi-series: multiple
seriesentries each withtype,name,data - Scatter:
series.data: [[x1,y1], [x2,y2], ...]format
6. Parse dimensions: "1080x1080" → W=1080, H=1080. Body = WxH. Output PNG = 2W × 2H.
Step 3: HTML Generation
Read ALL before generating:
references/chart-library.mdfor this chart type's full ECharts config specreferences/style-presets.mdfor the chosen style's CSS tokens + palette
Required HTML structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
[font CDN link from style preset]
<style>
:root {
[all CSS tokens from style preset]
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html,
Установить graphic-chart в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл graphic-chart?
Generates data visualization charts (bar, line, area, pie, doughnut, scatter, radar, treemap) as PNG using Apache ECharts v6. 1080×1080px default, 5 style presets, highlight annotations. Trigger when user says "create a chart", "visualize data", "make a bar chart", "line graph", "pie chart", "data visualization", "chart this data", "plot", "graph", or "visualize these numbers".
Как установить скилл graphic-chart?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл graphic-chart запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic