Communitygithub.com

그래픽 차트 - 데이터 시각화 PNG 생성

Apache ECharts v6을 사용하여 막대, 선, 영역, 파이, 도넛, 산점도, 레이더, 트리맵 차트를 PNG로 생성합니다. 1080×1080px 기본 해상도, 5가지 스타일 프리셋, 하이라이트 주석 기능을 제공합니다.

그래픽 차트 - 데이터 시각화 PNG 생성란 무엇인가요?

이 스킬은 개발자와 AI 에이전트 사용자가 데이터를 구조화된 JSON 또는 CSV 형식으로 제공하면, Apache ECharts v6 라이브러리를 활용하여 고품질 PNG 차트 이미지를 자동 생성합니다. 지원하는 차트 유형은 막대(bar), 선(line), 영역(area), 파이(pie), 도넛(doughnut), 산점도(scatter), 레이더(radar), 트리맵(treemap) 등 총 8가지이며, 각 유형에 맞는 ECharts 설정을 자동으로 구성합니다. 특히 CSS 변수 기반의 5가지 스타일 프리셋(clean-slate, midnight-editorial, matt-gray, electric-burst, brutalist)을 지원하여 배경색, 폰트, 색상 팔레트를 손쉽게 변경할 수 있습니다. 내부적으로는 Playwright를 이용해 headless Chromium에서 HTML을 렌더링한 후 2배 레티나(deviceScaleFactor: 2)로 스크린샷을 캡처하여 선명한 출력물을 제공합니다. 차트 제목은 데이터가 전달하는 인사이트를 명확히 드러내도록 작성되며, 특정 데이터 포인트를 시각적으로 강조하는 하이라이트 기능도 포함되어 있습니다. 이 모든 과정은 사용자에게 친숙한 JSON/CSV 입력과 명확한 차트 유형 지정만으로 완료됩니다.

지원 대상✓Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/Varnan-Tech/opendirectory/tree/main/skills/graphic-chart

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

그래픽 차트

데이터 시각화 차트를 PNG로 생성합니다. headless Chromium에서 Apache ECharts v6을 사용하여 HTML을 렌더링하고 Playwright를 통해 2배 레티나 품질로 스크린샷을 캡처합니다.

CDN: https://cdn.jsdelivr.net/npm/[email protected]/dist/echarts.min.js


중요 규칙 (생성할 때마다 반드시 읽을 것)

  1. area 유형 → type: 'line' + areaStyle: {} — ECharts에는 type: 'area'가 없습니다.
  2. doughnut → type: 'pie' + radius: ['40%', '70%'] — ECharts에는 type: 'doughnut'가 없습니다.
  3. 준비 신호: chart.on('finished', fn)을 chart.setOption() 이전에 등록 — ECharts 버그 #14101/#17500: setOption 후에 리스너를 등록하면 조용히 절대 실행되지 않습니다. 항상 finished와 rendered 이벤트를 setOption 전에 등록하세요.
  4. xAxis.type: 'category'는 반드시 명시적으로 설정 — ECharts는 데이터로부터 이를 추론하지 않습니다. 이를 잊으면 빈 차트가 생성됩니다.
  5. 범주 레이블은 xAxis.data에 넣고, data.labels 배열에 넣지 않음 — ECharts 구조는 평평합니다: { xAxis, yAxis, series, grid, title, legend } — data나 options 아래에 중첩되지 않습니다.
  6. 데이터 레이블은 완전히 내장됨 — 모든 시리즈에서 label: { show: true }를 사용하세요. 플러그인이 필요 없습니다.
  7. 특정 막대/포인트 강조는 항목별 itemStyle로 처리 — 데이터 배열에 { value: N, itemStyle: { color: '#...' } }를 직접 넣으세요. Chart.js 스타일의 backgroundColor 배열을 사용하지 마세요.
  8. ECharts 초기화는 <canvas>가 아닌 <div> 컨테이너를 사용 — echarts.init(document.getElementById('chart'))입니다. 컨테이너 div는 명시적인 크기가 필요합니다.
  9. 옵션에 animation: false — 즉시 렌더링을 위해 애니메이션을 비활성화합니다. 그래도 준비 신호를 위해 setOption 전에 finished + rendered 이벤트를 등록하세요.
  10. HTML을 채팅에 절대 덤프하지 마세요. 파일에 저장하고 요약만 표시하세요.
  11. 제목은 주제가 아닌 인사이트를 명시합니다. "월별 수익"이 아닌 "수익이 12개월 만에 3배 성장"
  12. 파이/도넛: body에 padding: 64px 80px 사용 및 .chart-container { max-height: 860px } — 제목이 없을 때 가장자리부터 채워지는 것을 방지합니다.

1단계: 입력 수집

필수: chart_type, data

선택적 매개변수 및 기본값:

매개변수기본값설명
chart_type—bar / line / area / pie / doughnut / scatter / radar / treemap
data—JSON 배열 또는 CSV — 필수
title—인사이트를 명시하며, 10단어 이하
subtitle—1문장 컨텍스트 줄
styleclean-slateclean-slate / midnight-editorial / matt-gray / electric-burst / brutalist
dimensions1080x1080WxH 픽셀 (출력 PNG는 deviceScaleFactor로 2배)
x_label—X축 레이블 텍스트
y_label—Y축 레이블 텍스트
source—바닥글에 표시되는 데이터 출처
highlight—강조할 데이터 레이블 (예: "Q4", "12월", 인덱스 3)

chart_type 또는 data가 없으면 정확히 다음과 같이 물어보세요:

"차트를 만들려면 다음이 필요합니다:

  1. 차트 유형 — bar / line / area / pie / doughnut / scatter / radar / treemap
  2. 데이터 — JSON 배열 또는 CSV로 제공 (예: 레이블 ['Q1','Q2','Q3','Q4','Q5']와 함께 [12, 18, 22, 25, 31])

선택 사항: title, style (기본값: clean-slate), dimensions (기본값: 1080×1080), 특정 데이터 포인트 강조"

둘 다 있으면 → 2단계로 이동합니다.


2단계: 내부 아키텍처 (사용자에게 절대 표시하지 않음)

1. 차트 유형 정규화:

  • area → 시리즈에 line + areaStyle: {}
  • doughnut → 시리즈에 pie + radius: ['40%', '70%']
  • horizontal bar → bar + xAxis/yAxis 교체 (범주 축이 y에)
  • 그 외: 그대로 사용

2. references/chart-library.md 읽기 — 이 차트 유형의 전체 설정 사양 로드

3. references/style-presets.md 읽기 — 선택된 스타일의 CSS 토큰 + 데이터 팔레트 로드

4. 디자인 방향 결정:

결정출처
톤전문 / 에디토리얼 / 대담 / 기술 — 데이터의 대상 독자에 맞춤
데이터 스토리이 차트가 증명하는 단일 인사이트 (제목이 됨)
강조 전략어떤 데이터 포인트에 시각적 강조가 필요한가? 왜?
배경밝음 (clean-slate, matt-gray) 또는 어두움 (midnight-editorial, electric-burst, brutalist)

5. 데이터 파싱:

  • 단순 배열 [12, 18, 22] → series.data, 레이블은 별도 제공
  • 객체 배열 [{x: '1월', y: 12}] → xAxis.data는 x 키에서, series.data는 y 값에서
  • CSV: 헤더 행을 xAxis.data로 파싱, 값 행을 series.data로 파싱
  • 다중 시리즈: 각각 type, name, data가 있는 여러 series 항목
  • 산점도: series.data: [[x1,y1], [x2,y2], ...] 형식

6. 크기 파싱: "1080x1080" → W=1080, H=1080. Body = WxH. 출력 PNG = 2W × 2H.


3단계: HTML 생성

생성하기 전에 모두 읽기:

  • 이 차트 유형의 전체 ECharts 설정 사양을 위한 references/chart-library.md
  • 선택된 스타일의 CSS 토큰 + 팔레트를 위한 references/style-presets.md

필수 HTML 구조:

<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
[스타일 프리셋의 폰트 CDN 링크]
<style>
:root {
  [스타일 프리셋의 모든 CSS 토큰]
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: [W]px; height: [H]px;
  overflow: hidden;
  background: var(--bg);
  font-family: var(--font-body);
}
body {
  display: flex;
  flex-direction: column;
  padding: 40px 48px 32px;   /* 파이/도넛: 64px 80px 사용 */
}

/* ECharts 컨테이너는 명시적 크기가 있어야 함 */
.chart-container {
  flex: 1;
  min-height: 0;
  /* 파이/도넛 전용: max-height: 860px; */
}

.chart-header { margin-bottom: 24px; }
.chart-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.chart-subtitle {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.chart-footer {
  margin-top: 14px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.65;
}
</style>
</head>
<body>

[제목 또는 부제목이 있으면: <div class="chart-header"><div class="chart-title">...</div>...</div>]

<div id="chart" class="chart-container"></div>

[출처가 있으면: <div class="chart-footer">출처: [source]</div>]

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

<script>
window.__chartReady = false;

document.fonts.ready.then(() => {
  const container = document.getElementById('chart');
  const chart = echarts.init(container, null, { renderer: 'canvas' });

  // 중요: setOption 전에 이벤트 등록 — ECharts 버그 #14101/#17500
  // 'finished'가 animation:false로 setOption 후에 등록되면 조용히 실행되지 않을 수 있음
  chart.on('finished', () => {
    window.__chartReady = true;
  });
  // 안전장치: 'rendered'를 통한 폴백
  chart.on('rendered', () => {
    clearTimeout(window.__renderDebounce);
    window.__renderDebounce = setTimeout(() => { window.__chartReady = true; }, 100);
  });

  const palette = [스타일 프리셋의 팔레트];

  const option = {
    animation: false,                            // 스크린샷을 위한 즉시 렌더링

    backgroundColor: 'transparent',             // body CSS가 배경색 처리

    textStyle: {
      fontFamily: '[--font-body 값]',
      color: '[--text-muted 값]',
    },

    [title 매개변수가 제공된 경우 title 설정],
    [차트 유형별 legend 설정],
    [차트 유형별 grid 설정],
    [차트 유형별 xAxis 설정],
    [차트 유형별 yAxis 설정],

    series: [{
      [이 유형에 대한 chart-library.md의 전체 시리즈 설정]
      [차트 유형별로 적용된 팔레트 색상]
      [강조가 있는 경우: 강조된 데이터 포인트에 항목별 itemStyle]
    }]
  };

  chart.setOption(option);   // setOption은 항상 이벤트 등록 후에 옴
});
</script>
</body>
</html>

디자인 품질 규칙:

  • 제목 폰트: fontWeight: 'bold', fontSize: 20–24 — 얇은 제목 금지
  • 그리드 선: 낮은 불투명도 (0.06–0.10) — 데이터에 종속
  • 막대: barMaxWidth: 60, itemStyle.borderRadius: [4,4,0,0]로 둥글게
  • 선: 자연스러운 곡선을 위해 smooth: true, 포인트를 위해 symbolSize: 8
  • 파이/도넛: 내장 슬라이스 레이블을 위해 label.formatter: '{b}\n{d}%'
  • 어두운 프리셋: 그리드 rgba(255,255,255,0.07), 축 선/눈금 색상 rgba(255,255,255,0.15)
  • 툴팁: show: false — 정적 PNG, 호버 상호작용 없음
  • 제목이 제공되지 않을 때: .chart-header 생략, ECharts 옵션에서 title 생략

4단계: 자체 QA (5단계 전에 모든 실패 수정)

구조:

  • 컨테이너는 <div>이며 <canvas>가 아님
  • window.__chartReady = false가 document.fonts.ready 전에 선언됨
  • chart.on('finished', ...)가 chart.setOption() 전에 등록됨
  • chart.on('rendered', ...) 디바운스 폴백이 chart.setOption() 전에 등록됨
  • 옵션 객체에 animation: false가 있음
  • chart.setOption(option)이 init 블록의 마지막 호출임

유형별:

  • 영역: type: 'line' + areaStyle: {} — type: 'area' 없음
  • 도넛: type: 'pie' + radius: ['40%', '70%'] — type: 'doughnut' 없음
  • 막대: xAxis.type: 'category'가 명시적으로 설정됨
  • 범주 데이터가 xAxis.data에 있음 (data.labels 아님)
  • 파이/도넛: body padding: 64px 80px + .chart-container { max-height: 860px }
  • 강조: 데이터 배열에 항목별 { value: N, itemStyle: { color } }

디자인:

  • 모든 팔레트 색상이 references/style-presets.md에서 왔음
  • 제목이 인사이트를 명시함 (단순 주제가 아님)
  • tooltip: { show: false } 또는 생략 (정적 PNG에 호버 없음)
  • 어두운 프리셋: 그리드/축 색상이 rgba(255,255,255,...) 사용
  • source 매개변수가 제공된 경우 바닥글에 출처 있음
  • 데이터 레이블이 보임 (시리즈에 내장 label: { show: true })

5단계: 내보내기

제목 또는 차트 유형 + 데이터 컨텍스트에서 슬러그 결정 (케밥 케이스, 30자 이하):

mkdir -p chart/[slug]

HTML 저장: chart/[slug]/chart.html

빠른 브라우저 확인:

open chart/[slug]/chart.html

내보내기 실행 ([skill-root]를 이 스킬 디렉터리의 실제 경로로 바꾸기):

bash [skill-root]/scripts/export-chart.sh \
  chart/[slug]/chart.html \
  chart/[slug]/chart.png \
  --width [W] \
  --height [H]

스크립트는 첫 실행 시 Playwright를 설치하고 (~200MB Chromium 다운로드), deviceScaleFactor: 2로 차트를 캡처합니다.


6단계: 출력 요약

## 차트: [title]
날짜: [YYYY-MM-DD] | 유형: [chart_type] | 스타일: [style]
크기: [W×H]px → PNG: [2W×2H]px @2배 레티나

파일
  소스:   chart/[slug]/chart.html
  출력:   chart/[slug]/chart.png
  크기:     [X] KB

체크리스트
- [ ] 제목이 인사이트를 명확히 명시함
- [ ] 데이터 레이블이 표시 크기에서 읽기 쉬움
- [ ] 강조가 올바른 데이터 포인트에 표시됨
- [ ] 바닥글에 출처 표시가 있음

프롬프트 팁 (사용자가 안내를 요청할 때 표시)

"구조화된 데이터를 제공하세요 — JSON 또는 CSV, 설명문이 아닙니다."

"차트 유형을 명시적으로 지정하세요. '분기를 보여주는 차트'가 아닌 'Q1–Q4를 비교하는 막대 차트'"

"데이터 스토리를 지정하세요. '다른 모든 분기보다 뛰어난 Q4 강조'가 주석 컨텍스트를 제공합니다."

✅ 좋은 예: "선 차트를 만들어 주세요. 제목: '12개월 만에 $12k에서 $95k ARR로'. 데이터: [12, 18, 22, 25, 31, 38, 44, 52, 61, 68, 78, 95] (2024년 1월~12월). 12월 강조. 출처: 내부 CRM. 스타일: electric-burst."

❌ 나쁜 예: "우리 회사 성장에 대한 차트 만들어 줘"

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

Varnan-Tech/opendirectory

Use when the user asks to generate a blog cover image, thumbnail, or article header. Automatically uses modern typography, brand logos, and Google Search grounding to create beautiful 16:9 images with Gemini 3.1 Flash Image Preview.

Varnan-Tech/opendirectory

World-class brand strategist and naming expert. Uses an interrogation-led discovery phase to extract your brand's DNA, then applies scientific naming frameworks (Phonosemantics) and automated multi-TLD domain checking.

Varnan-Tech/opendirectory

Use when the user asks to generate or update a project's CLAUDE or AGENTS context file from a codebase scan. Writes a focused file under 100 lines containing only the non-obvious build commands, conventions, and gotchas Claude Code needs.

Varnan-Tech/opendirectory

Use when the user wants to verify cold emails, enrich a lead list, or autonomously guess email addresses from a CSV using ValidEmail.co or the open-source Reacher engine.

Varnan-Tech/opendirectory

Competitive intelligence orchestrator tracking companies across 8+ platforms (GitHub, Twitter, Reddit, HN, PH, YC Jobs) with heat scores and AI briefings.

Varnan-Tech/opendirectory

Give it your product URL or description. It finds your top 5 competitors, runs three-track PR research across all of them (editorial, podcasts, communities), identifies which channels appear most frequently, looks up the journalist or host for each, and returns a tiered outreach list with story angles and ready-to-send cold pitch drafts tailored to your product. Use when asked to find PR opportunities, discover where competitors got featured, build a media outreach list, find which journalists cover my space, or get pitch templates for press coverage.

Varnan-Tech/opendirectory

Generate high-converting, deep-dive growth case studies in MDX format. Use this skill when asked to write a case study or blog post about a company's growth, tech stack, or product-led strategy. It handles the full pipeline (researching the company via Tavily, generating a 16:9 cover image, quality checking the draft, uploading assets to cloud storage, and pushing directly to the target repository).

Varnan-Tech/opendirectory

Scans your project for outdated npm, pip, Cargo, Go, or Ruby packages. Runs a CVE security audit. Fetches changelogs, summarizes breaking changes with Gemini, and opens one PR per risk group (patch, minor, major). Includes Diagnosis Mode for install conflicts. Use when asked to update dependencies, check for outdated packages, open dependency PRs, scan for package updates, audit for CVEs, or flag breaking changes in upgrades. Trigger when a user says "check for outdated packages", "update my dependencies", "open PRs for dependency updates", "scan for CVEs", or "which packages need upgrading".

Varnan-Tech/opendirectory

Generates and updates README.md and API reference docs by reading your codebase's functions, routes, types, schemas, and architecture. Uses graphify to build a knowledge graph first, then writes accurate docs from it. Use when asked to write docs, generate a README, document an API, update stale docs, create an API reference from code, add an architecture section, or document a project in any language. Trigger when a user says their docs are missing, outdated, or wants to document their codebase without writing it manually.

Varnan-Tech/opendirectory

Evaluates expired domain candidates against a target niche, scores them by topical relevance, historical activity level, and history cleanliness, then outputs a ranked shortlist with explainable reasoning and risk flags.

Varnan-Tech/opendirectory

Brutally honest developer-experience audit for a GitHub repo. Scores 10 DX dimensions (time-to-first-success, README clarity, visual proof, install, quick-start, docs, examples, community, trust, marketing), writes a shareable roast in the requested tone (brutal/honest/kind), produces a prioritized action plan ranked by impact × effort, and sketches an ideal README. Trigger when user says "roast my repo", "audit my README", "dx audit", "developer experience review", "score my GitHub project", "before launch checklist", or "make my repo shareable".

Varnan-Tech/opendirectory

Drafts and designs a complete HTML email newsletter from a topic or content brief. Outputs paste-ready HTML for Loops, Mailchimp, Beehiiv, Resend, or any standard email platform. Includes subject line options and plain-text fallback. Trigger when a user says "write a newsletter", "draft an email newsletter", "create an HTML email", "design an email for my subscribers", or "write a newsletter about [topic]".

Varnan-Tech/opendirectory

Takes a GitHub PR URL or the current branch and writes a plain-English explanation of what it does and why, then posts it as a PR comment. Use when asked to explain a PR, summarize a pull request, write a plain-English description of a PR, add a summary comment to a PR, or understand what a PR changes. Trigger when a user says "explain this PR", "summarize this pull request", "what does this PR do", "add a comment explaining the PR", or shares a GitHub PR URL and asks what it does.

Varnan-Tech/opendirectory

Audit how often LLMs recommend your brand vs competitors and generate a GEO action plan.

Varnan-Tech/opendirectory

Takes a competitor's public GitHub repo URL, fetches their open issues via the GitHub REST API, filters noise locally, clusters issues into 6 demand categories, computes a demand score per issue and per cluster, and outputs a ranked demand gap report with a GTM messaging brief. Use when asked to scan a competitor's GitHub issues, find what their users are begging for, turn GitHub complaints into product positioning, identify competitor feature gaps, or generate messaging from real user demand. Trigger when a user says "scan competitor issues", "what are users asking for on X repo", "find demand gaps in Y", "turn GitHub issues into messaging", or "what should I build based on competitor complaints".

Varnan-Tech/opendirectory

Find recurring confusion in your repo's GitHub Discussions, rank it by urgency, and draft the actual docs fixes and content angles — with verbatim community quotes and source links as evidence.

Varnan-Tech/opendirectory

SEO keyword research workflow for blog generation using Google Trends data. Use when writing blog posts, planning content calendars, or optimizing articles for search engines. Finds breakout keywords, builds content structure, and generates SEO-optimized blog outlines targeting tech and developer audiences.

Varnan-Tech/opendirectory

Generates a professionally designed case study PDF for B2B SaaS sales and marketing. Supports 7 page layouts, 9 style presets, 1-4 page output. Trigger when user says "create a case study", "write a customer story", "make a case study PDF", "design a success story", "turn this customer win into a PDF".

Varnan-Tech/opendirectory

Creates professionally designed B2B SaaS e-books in HTML + CSS, exported as print-ready PDF. 3–10 pages, 9 style presets, 11 page layout types. Trigger when user says "create an ebook", "design a lead magnet", "make a PDF guide", "build a gated content piece", "write a B2B ebook", "design a white paper", "create a nurture asset", or "make a PDF report".

Varnan-Tech/opendirectory

Fetches low-star App Store and Google Play reviews, clusters them into broken-promise patterns, and generates a ranked copy brief with positioning opportunities.

관련 스킬