chart-generation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseChart Generation Skill
图表生成技能
Generate accurate, data-driven charts and visualizations using Python (matplotlib/plotly).
Use this for real data. For concept art and illustrations, use instead.
image-generation使用Python(matplotlib/plotly)生成精准的、数据驱动的图表与可视化内容。
本技能适用于真实数据场景。若需制作概念图与插画,请使用技能。
image-generationWhat It Produces
生成内容说明
| Chart Type | Use Case | Script |
|---|---|---|
| Bar Chart | Compare values across categories | |
| Line Chart | Show trends over time | |
| Pie Chart | Show proportions/percentages | |
| Positioning Matrix | 2x2 competitive positioning | |
| Comparison Table | Feature comparison grid | |
| TAM/SAM/SOM | Market size visualization | |
| 图表类型 | 适用场景 | 脚本文件 |
|---|---|---|
| 柱状图 | 对比不同分类下的数值 | |
| 折线图 | 展示随时间变化的趋势 | |
| 饼图 | 展示占比/百分比 | |
| 定位矩阵 | 2x2竞争定位分析 | |
| 对比表格 | 功能对比网格 | |
| TAM/SAM/SOM | 市场规模可视化 | |
Prerequisites
前置依赖
bash
pip install matplotlib numpy pillowNo API keys required - runs locally.
bash
pip install matplotlib numpy pillow无需API密钥 - 本地运行即可。
When to Use This vs Image Generation
本技能与图像生成技能的适用场景区分
| Scenario | Use This | Use 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.pngOptions:
- - Horizontal bars instead of vertical
--horizontal - - Custom colors:
--colors'["#4CAF50", "#2196F3", "#FF9800"]' - - Display values on bars
--show-values
对比不同分类下的数值。
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.pngOptions:
- - Multiple lines:
--multi--y '[[100,150,200], [80,120,180]]' --legend '["Product A", "Product B"]' - - Fill area under line
--fill - - Show data point markers
--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.pngOptions:
- - Donut chart (hollow center)
--donut - - Explode a slice:
--explode(first slice)--explode 0 - - Show percentages on slices
--show-percent
展示占比与百分比。
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.pngOptions:
- - Label quadrants:
--quadrant-labels'["Niche", "Leaders", "Laggards", "Challengers"]' - - Highlight your position:
--highlight--highlight 0 - - Bubble sizes for market share
--sizes
基于两个维度的竞争定位分析。
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.pngOptions:
- - Highlight your column:
--highlight-column--highlight-column 0 - - Use colors instead of symbols
--colors
生成图片格式的功能对比网格。
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.pngOptions:
- - "B" for billions, "M" for millions
--unit - - Custom labels:
--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可选参数:
- - 单位:"B"代表十亿,"M"代表百万
--unit - - 自定义标签:
--labels'["Total Market", "Serviceable", "Obtainable"]'
Usage by Other Skills
其他技能的调用示例
competitive-intel-agent
competitive-intel-agent
python
undefinedpython
undefinedGenerate positioning matrix from analysis
基于分析结果生成定位矩阵
positioning_matrix.py
--companies '["You", "Salesforce", "HubSpot"]'
--x-values '[30, 95, 70]'
--y-values '[75, 90, 60]'
--companies '["You", "Salesforce", "HubSpot"]'
--x-values '[30, 95, 70]'
--y-values '[75, 90, 60]'
undefinedpositioning_matrix.py
--companies '["You", "Salesforce", "HubSpot"]'
--x-values '[30, 95, 70]'
--y-values '[75, 90, 60]'
--companies '["You", "Salesforce", "HubSpot"]'
--x-values '[30, 95, 70]'
--y-values '[75, 90, 60]'
undefinedmarket-researcher-agent
market-researcher-agent
python
undefinedpython
undefinedGenerate TAM/SAM/SOM from research
基于调研数据生成TAM/SAM/SOM图表
tam_sam_som.py --tam 120 --sam 15 --som 2.5 --unit "B"
undefinedtam_sam_som.py --tam 120 --sam 15 --som 2.5 --unit "B"
undefinedpitch-deck-agent
pitch-deck-agent
python
undefinedpython
undefinedGenerate traction chart
生成增长趋势图表
line_chart.py
--x '["Q1", "Q2", "Q3", "Q4"]'
--y '[50, 120, 280, 500]'
--title "Revenue Growth"
--x '["Q1", "Q2", "Q3", "Q4"]'
--y '[50, 120, 280, 500]'
--title "Revenue Growth"
undefinedline_chart.py
--x '["Q1", "Q2", "Q3", "Q4"]'
--y '[50, 120, 280, 500]'
--title "Revenue Growth"
--x '["Q1", "Q2", "Q3", "Q4"]'
--y '[50, 120, 280, 500]'
--title "Revenue Growth"
undefinedreview-analyst-agent
review-analyst-agent
python
undefinedpython
undefinedGenerate sentiment distribution
生成评论情感分布饼图
pie_chart.py
--labels '["Positive", "Neutral", "Negative"]'
--values '[65, 20, 15]'
--title "Review Sentiment"
--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"
--labels '["Positive", "Neutral", "Negative"]'
--values '[65, 20, 15]'
--title "Review Sentiment"
---Output Formats
输出格式
All scripts support:
- - PNG image (default)
--output file.png - - SVG vector
--output file.svg - - PDF document
--output file.pdf
所有脚本均支持以下输出格式:
- - PNG图片(默认格式)
--output file.png - - SVG矢量图
--output file.svg - - PDF文档
--output file.pdf
Styling Options
样式自定义选项
All scripts support these common options:
| Option | Description | Example |
|---|---|---|
| Chart title | |
| Width in inches | |
| Height in inches | |
| Resolution | |
| Matplotlib style | |
| Custom color palette | |
| Base font size | |
所有脚本均支持以下通用样式选项:
| 选项 | 说明 | 示例 |
|---|---|---|
| 图表标题 | |
| 图表宽度(英寸) | |
| 图表高度(英寸) | |
| 分辨率 | |
| Matplotlib样式 | |
| 自定义调色板 | |
| 基础字体大小 | |
Integration Pattern
集成模式
Higher-level skills call chart-generation like this:
markdown
undefined高阶技能可通过以下方式调用本图表生成技能:
markdown
undefinedIn competitive-intel-agent workflow:
在competitive-intel-agent工作流中的调用示例:
- Analyze competitors (gather data)
- Structure data as JSON
- Call chart-generation script with data
- Embed resulting PNG in report
**Example flow:**
```python- 分析竞争对手(收集数据)
- 将数据整理为JSON格式
- 传入数据调用图表生成脚本
- 将生成的PNG图片嵌入报告
**示例流程:**
```python1. 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
--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
--labels '["You", "Competitor A", "Competitor B"]'
--values '[8, 6, 5]'
--title "Feature Count Comparison"
--output features.png
3. Embed in report
3. 嵌入报告

---
---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亿美元"