chart-generation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Chart Generation Skill

图表生成技能

Generate accurate, data-driven charts and visualizations using Python (matplotlib/plotly).
Use this for real data. For concept art and illustrations, use
image-generation
instead.
使用Python(matplotlib/plotly)生成精准的、数据驱动的图表与可视化内容。
本技能适用于真实数据场景。若需制作概念图与插画,请使用
image-generation
技能。

What It Produces

生成内容说明

Chart TypeUse CaseScript
Bar ChartCompare values across categories
bar_chart.py
Line ChartShow trends over time
line_chart.py
Pie ChartShow proportions/percentages
pie_chart.py
Positioning Matrix2x2 competitive positioning
positioning_matrix.py
Comparison TableFeature comparison grid
comparison_table.py
TAM/SAM/SOMMarket size visualization
tam_sam_som.py
图表类型适用场景脚本文件
柱状图对比不同分类下的数值
bar_chart.py
折线图展示随时间变化的趋势
line_chart.py
饼图展示占比/百分比
pie_chart.py
定位矩阵2x2竞争定位分析
positioning_matrix.py
对比表格功能对比网格
comparison_table.py
TAM/SAM/SOM市场规模可视化
tam_sam_som.py

Prerequisites

前置依赖

bash
pip install matplotlib numpy pillow
No API keys required - runs locally.
bash
pip install matplotlib numpy pillow
无需API密钥 - 本地运行即可。

When to Use This vs Image Generation

本技能与图像生成技能的适用场景区分

ScenarioUse ThisUse image-generation
Real data from analysis
Accurate numbers/labels
Reproducible charts
Concept/mockup visuals
Artistic illustrations
Icons and graphics

场景使用本技能使用image-generation
分析得出的真实数据
需要精准的数值/标签
可重复生成的图表
概念/原型图
艺术插画
图标与图形

Chart Types

图表类型详情

1. Bar Chart

1. 柱状图

Compare values across categories.
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/bar_chart.py \
  --labels '["Product A", "Product B", "Product C"]' \
  --values '[85, 62, 45]' \
  --title "Feature Comparison" \
  --ylabel "Score" \
  --output bar_chart.png
Options:
  • --horizontal
    - Horizontal bars instead of vertical
  • --colors
    - Custom colors:
    '["#4CAF50", "#2196F3", "#FF9800"]'
  • --show-values
    - Display values on bars

对比不同分类下的数值。
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/bar_chart.py \
  --labels '["Product A", "Product B", "Product C"]' \
  --values '[85, 62, 45]' \
  --title "Feature Comparison" \
  --ylabel "Score" \
  --output bar_chart.png
可选参数:
  • --horizontal
    - 生成水平方向的柱状图(默认垂直)
  • --colors
    - 自定义颜色:
    '["#4CAF50", "#2196F3", "#FF9800"]'
  • --show-values
    - 在柱状图上显示具体数值

2. Line Chart

2. 折线图

Show trends over time or progression.
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/line_chart.py \
  --x '["Jan", "Feb", "Mar", "Apr", "May", "Jun"]' \
  --y '[100, 150, 180, 220, 310, 450]' \
  --title "Monthly Revenue Growth" \
  --xlabel "Month" \
  --ylabel "Revenue ($K)" \
  --output growth_chart.png
Options:
  • --multi
    - Multiple lines:
    --y '[[100,150,200], [80,120,180]]' --legend '["Product A", "Product B"]'
  • --fill
    - Fill area under line
  • --markers
    - Show data point markers

展示随时间或过程变化的趋势。
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/line_chart.py \
  --x '["Jan", "Feb", "Mar", "Apr", "May", "Jun"]' \
  --y '[100, 150, 180, 220, 310, 450]' \
  --title "Monthly Revenue Growth" \
  --xlabel "Month" \
  --ylabel "Revenue ($K)" \
  --output growth_chart.png
可选参数:
  • --multi
    - 生成多条折线:
    --y '[[100,150,200], [80,120,180]]' --legend '["Product A", "Product B"]'
  • --fill
    - 填充折线下方区域
  • --markers
    - 显示数据点标记

3. Pie Chart

3. 饼图

Show proportions and percentages.
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/pie_chart.py \
  --labels '["Engineering", "Marketing", "Sales", "Operations"]' \
  --values '[40, 25, 20, 15]' \
  --title "Use of Funds" \
  --output pie_chart.png
Options:
  • --donut
    - Donut chart (hollow center)
  • --explode
    - Explode a slice:
    --explode 0
    (first slice)
  • --show-percent
    - Show percentages on slices

展示占比与百分比。
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/pie_chart.py \
  --labels '["Engineering", "Marketing", "Sales", "Operations"]' \
  --values '[40, 25, 20, 15]' \
  --title "Use of Funds" \
  --output pie_chart.png
可选参数:
  • --donut
    - 生成环形饼图(空心中心)
  • --explode
    - 突出显示某一块:
    --explode 0
    (第一块)
  • --show-percent
    - 在饼块上显示百分比

4. Positioning Matrix (2x2)

4. 定位矩阵(2x2)

Competitive positioning on two axes.
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/positioning_matrix.py \
  --companies '["Your Product", "Competitor A", "Competitor B", "Competitor C"]' \
  --x-values '[70, 90, 50, 30]' \
  --y-values '[80, 85, 60, 45]' \
  --x-label "Price (Low → High)" \
  --y-label "Features (Basic → Advanced)" \
  --title "Competitive Positioning" \
  --output positioning.png
Options:
  • --quadrant-labels
    - Label quadrants:
    '["Niche", "Leaders", "Laggards", "Challengers"]'
  • --highlight
    - Highlight your position:
    --highlight 0
  • --sizes
    - Bubble sizes for market share

基于两个维度的竞争定位分析。
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/positioning_matrix.py \
  --companies '["Your Product", "Competitor A", "Competitor B", "Competitor C"]' \
  --x-values '[70, 90, 50, 30]' \
  --y-values '[80, 85, 60, 45]' \
  --x-label "Price (Low → High)" \
  --y-label "Features (Basic → Advanced)" \
  --title "Competitive Positioning" \
  --output positioning.png
可选参数:
  • --quadrant-labels
    - 为四个象限添加标签:
    '["Niche", "Leaders", "Laggards", "Challengers"]'
  • --highlight
    - 突出显示自身产品位置:
    --highlight 0
  • --sizes
    - 用气泡大小表示市场份额

5. Comparison Table

5. 对比表格

Feature comparison grid as an image.
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/comparison_table.py \
  --features '["Feature A", "Feature B", "Feature C", "Feature D"]' \
  --companies '["You", "Comp A", "Comp B"]' \
  --data '[["✓", "✓", "✗"], ["✓", "✗", "✓"], ["✓", "✓", "✓"], ["✓", "✗", "✗"]]' \
  --title "Feature Comparison" \
  --output comparison.png
Options:
  • --highlight-column
    - Highlight your column:
    --highlight-column 0
  • --colors
    - Use colors instead of symbols

生成图片格式的功能对比网格。
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/comparison_table.py \
  --features '["Feature A", "Feature B", "Feature C", "Feature D"]' \
  --companies '["You", "Comp A", "Comp B"]' \
  --data '[["✓", "✓", "✗"], ["✓", "✗", "✓"], ["✓", "✓", "✓"], ["✓", "✗", "✗"]]' \
  --title "Feature Comparison" \
  --output comparison.png
可选参数:
  • --highlight-column
    - 突出显示自身产品列:
    --highlight-column 0
  • --colors
    - 用颜色替代符号表示状态

6. TAM/SAM/SOM Chart

6. TAM/SAM/SOM图表

Market size visualization (concentric circles).
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/tam_sam_som.py \
  --tam 50 \
  --sam 8 \
  --som 0.5 \
  --unit "B" \
  --title "Market Opportunity" \
  --output market_size.png
Options:
  • --unit
    - "B" for billions, "M" for millions
  • --labels
    - Custom labels:
    '["Total Market", "Serviceable", "Obtainable"]'

市场规模可视化(同心圆形式)。
bash
python3 ${SKILL_PATH}/skills/chart-generation/scripts/tam_sam_som.py \
  --tam 50 \
  --sam 8 \
  --som 0.5 \
  --unit "B" \
  --title "Market Opportunity" \
  --output market_size.png
可选参数:
  • --unit
    - 单位:"B"代表十亿,"M"代表百万
  • --labels
    - 自定义标签:
    '["Total Market", "Serviceable", "Obtainable"]'

Usage by Other Skills

其他技能的调用示例

competitive-intel-agent

competitive-intel-agent

python
undefined
python
undefined

Generate positioning matrix from analysis

基于分析结果生成定位矩阵

positioning_matrix.py
--companies '["You", "Salesforce", "HubSpot"]'
--x-values '[30, 95, 70]'
--y-values '[75, 90, 60]'
undefined
positioning_matrix.py
--companies '["You", "Salesforce", "HubSpot"]'
--x-values '[30, 95, 70]'
--y-values '[75, 90, 60]'
undefined

market-researcher-agent

market-researcher-agent

python
undefined
python
undefined

Generate TAM/SAM/SOM from research

基于调研数据生成TAM/SAM/SOM图表

tam_sam_som.py --tam 120 --sam 15 --som 2.5 --unit "B"
undefined
tam_sam_som.py --tam 120 --sam 15 --som 2.5 --unit "B"
undefined

pitch-deck-agent

pitch-deck-agent

python
undefined
python
undefined

Generate traction chart

生成增长趋势图表

line_chart.py
--x '["Q1", "Q2", "Q3", "Q4"]'
--y '[50, 120, 280, 500]'
--title "Revenue Growth"
undefined
line_chart.py
--x '["Q1", "Q2", "Q3", "Q4"]'
--y '[50, 120, 280, 500]'
--title "Revenue Growth"
undefined

review-analyst-agent

review-analyst-agent

python
undefined
python
undefined

Generate sentiment distribution

生成评论情感分布饼图

pie_chart.py
--labels '["Positive", "Neutral", "Negative"]'
--values '[65, 20, 15]'
--title "Review Sentiment"

---
pie_chart.py
--labels '["Positive", "Neutral", "Negative"]'
--values '[65, 20, 15]'
--title "Review Sentiment"

---

Output Formats

输出格式

All scripts support:
  • --output file.png
    - PNG image (default)
  • --output file.svg
    - SVG vector
  • --output file.pdf
    - PDF document

所有脚本均支持以下输出格式:
  • --output file.png
    - PNG图片(默认格式)
  • --output file.svg
    - SVG矢量图
  • --output file.pdf
    - PDF文档

Styling Options

样式自定义选项

All scripts support these common options:
OptionDescriptionExample
--title
Chart title
"Monthly Revenue"
--width
Width in inches
12
--height
Height in inches
8
--dpi
Resolution
150
--style
Matplotlib style
"seaborn"
,
"dark_background"
--colors
Custom color palette
'["#4CAF50", "#2196F3"]'
--font-size
Base font size
12

所有脚本均支持以下通用样式选项:
选项说明示例
--title
图表标题
"Monthly Revenue"
--width
图表宽度(英寸)
12
--height
图表高度(英寸)
8
--dpi
分辨率
150
--style
Matplotlib样式
"seaborn"
,
"dark_background"
--colors
自定义调色板
'["#4CAF50", "#2196F3"]'
--font-size
基础字体大小
12

Integration Pattern

集成模式

Higher-level skills call chart-generation like this:
markdown
undefined
高阶技能可通过以下方式调用本图表生成技能:
markdown
undefined

In competitive-intel-agent workflow:

在competitive-intel-agent工作流中的调用示例:

  1. Analyze competitors (gather data)
  2. Structure data as JSON
  3. Call chart-generation script with data
  4. Embed resulting PNG in report

**Example flow:**
```python
  1. 分析竞争对手(收集数据)
  2. 将数据整理为JSON格式
  3. 传入数据调用图表生成脚本
  4. 将生成的PNG图片嵌入报告

**示例流程:**
```python

1. Analysis produces this data

1. 分析后得到如下数据

data = { "companies": ["You", "Competitor A", "Competitor B"], "features": [8, 6, 5], "prices": [29, 49, 39] }
data = { "companies": ["You", "Competitor A", "Competitor B"], "features": [8, 6, 5], "prices": [29, 49, 39] }

2. Generate chart

2. 生成图表

python3 bar_chart.py
--labels '["You", "Competitor A", "Competitor B"]'
--values '[8, 6, 5]'
--title "Feature Count Comparison"
--output features.png
python3 bar_chart.py
--labels '["You", "Competitor A", "Competitor B"]'
--values '[8, 6, 5]'
--title "Feature Count Comparison"
--output features.png

3. Embed in report

3. 嵌入报告

Feature Comparison

---
Feature Comparison

---

Example Prompts

示例提示词

Direct chart creation:
"Create a bar chart comparing our features to competitors"
As part of analysis:
"Analyze these companies and generate a positioning matrix"
Data visualization:
"Plot our monthly revenue growth from this data: [100, 150, 220, 350]"
Market sizing:
"Create a TAM/SAM/SOM chart: TAM $50B, SAM $5B, SOM $500M"
直接创建图表:
"创建一个对比我方与竞品功能的柱状图"
结合分析场景:
"分析这些公司并生成一份定位矩阵"
数据可视化:
"根据以下数据绘制月度收入增长折线图:[100, 150, 220, 350]"
市场规模分析:
"创建TAM/SAM/SOM图表:TAM 500亿美元,SAM 50亿美元,SOM 5亿美元"