Skill Tracer
Skills › Financial Services › initiating-coverage › task4-chart-generation.md

task4-chart-generation.md

920 lines · plugins/vertical-plugins/equity-research/skills/initiating-coverage/references/task4-chart-generation.md at 6056506

Open on GitHub
1# Task 4: Chart Generation - Detailed Workflow
2
3This document provides step-by-step instructions for executing Task 4 (Chart Generation) of the initiating-coverage skill.
4

Task 4: Chart Generation - Detailed Workflow

This document provides step-by-step instructions for executing Task 4 (Chart Generation) of the initiating-coverage skill.

Raw lines 1 to 4
5## Task Overview
6
7**Purpose**: Generate 25-35 professional financial charts for the report.
8
9**Prerequisites**: ⚠️ Verify before starting
10- **Required**: Company research from Task 1
11 - Company history, milestones (for timeline charts)
12 - Management team, org structure (for org charts)
13 - Product portfolio (for product charts)
14 - Customer segmentation (for customer charts)
15 - Competitive landscape (for competitive positioning charts)
16 - TAM analysis (for market size charts)
17- **Required**: Financial model from Task 2
18 - Revenue by product/geography data
19 - Margin trends
20 - Scenario comparison data
21- **Required**: Valuation analysis from Task 3
22 - DCF sensitivity table
23 - Comparable companies data
24 - Valuation ranges
25- **Required**: External market data
26 - Historical stock price data (Yahoo Finance, Bloomberg)
27 - Historical valuation multiples (optional for chart 34)
29**⚠️ CRITICAL: DO NOT START THIS TASK UNLESS TASKS 1, 2, AND 3 ARE COMPLETE**
31This task requires outputs from all three previous tasks. Starting without them will result in incomplete charts.
33**IF ANY OF TASKS 1, 2, OR 3 ARE NOT COMPLETE**: Stop immediately and inform the user which tasks need to be completed first. The specific requirements are:
34- Task 1: Company research document (for 9 charts)
35- Task 2: Financial model with all 6 tabs (for 8 charts)
36- Task 3: Valuation tabs added to the model (for 6 charts)
37- External data access (for 2 charts)
39Do not attempt to create placeholder charts or skip charts due to missing data.
41**Output**: 25-35 Professional Chart Files (PNG/JPG, 300 DPI)
43---

Task Overview

Purpose: Generate 25-35 professional financial charts for the report.

Prerequisites: ⚠️ Verify before starting

  • Required: Company research from Task 1
  • Company history, milestones (for timeline charts)
  • Management team, org structure (for org charts)
  • Product portfolio (for product charts)
  • Customer segmentation (for customer charts)
  • Competitive landscape (for competitive positioning charts)
  • TAM analysis (for market size charts)
  • Required: Financial model from Task 2
  • Revenue by product/geography data
  • Margin trends
  • Scenario comparison data
  • Required: Valuation analysis from Task 3
  • DCF sensitivity table
  • Comparable companies data
  • Valuation ranges
  • Required: External market data
  • Historical stock price data (Yahoo Finance, Bloomberg)
  • Historical valuation multiples (optional for chart 34)

⚠️ CRITICAL: DO NOT START THIS TASK UNLESS TASKS 1, 2, AND 3 ARE COMPLETE

This task requires outputs from all three previous tasks. Starting without them will result in incomplete charts.

IF ANY OF TASKS 1, 2, OR 3 ARE NOT COMPLETE: Stop immediately and inform the user which tasks need to be completed first. The specific requirements are:

  • Task 1: Company research document (for 9 charts)
  • Task 2: Financial model with all 6 tabs (for 8 charts)
  • Task 3: Valuation tabs added to the model (for 6 charts)
  • External data access (for 2 charts)

Do not attempt to create placeholder charts or skip charts due to missing data.

Output: 25-35 Professional Chart Files (PNG/JPG, 300 DPI)


Raw lines 5 to 44
45## Input Verification
47**BEFORE STARTING - CHECK ALL PREREQUISITES:**

Input Verification

BEFORE STARTING - CHECK ALL PREREQUISITES:

Raw lines 45 to 48
49### Task 1 Verification (Company Research)
50- [ ] Task 1 complete? (Company research document exists)
51- [ ] Company history and milestones documented? (for charts 05, 06)
52- [ ] Management team and org structure described? (for chart 07)
53- [ ] Product portfolio detailed? (for chart 08)
54- [ ] Customer segmentation analyzed? (for chart 09)
55- [ ] Competitive landscape mapped? (for charts 16, 17, 18)
56- [ ] TAM sizing completed? (for chart 15)

Task 1 Verification (Company Research)

  • [ ] Task 1 complete? (Company research document exists)
  • [ ] Company history and milestones documented? (for charts 05, 06)
  • [ ] Management team and org structure described? (for chart 07)
  • [ ] Product portfolio detailed? (for chart 08)
  • [ ] Customer segmentation analyzed? (for chart 09)
  • [ ] Competitive landscape mapped? (for charts 16, 17, 18)
  • [ ] TAM sizing completed? (for chart 15)
Raw lines 49 to 57
58### Task 2 Verification (Financial Model)
59- [ ] Task 2 complete? (Financial model Excel file exists)
60- [ ] Revenue by product breakdown available? (for chart 03 ⭐)
61- [ ] Revenue by geography breakdown available? (for chart 04 ⭐)
62- [ ] Historical + projected financials complete? (for charts 02, 10, 11, 12)
63- [ ] Scenario analysis (Bull/Base/Bear) complete? (for chart 14)
64- [ ] Operating metrics available? (for chart 13)

Task 2 Verification (Financial Model)

  • [ ] Task 2 complete? (Financial model Excel file exists)
  • [ ] Revenue by product breakdown available? (for chart 03 ⭐)
  • [ ] Revenue by geography breakdown available? (for chart 04 ⭐)
  • [ ] Historical + projected financials complete? (for charts 02, 10, 11, 12)
  • [ ] Scenario analysis (Bull/Base/Bear) complete? (for chart 14)
  • [ ] Operating metrics available? (for chart 13)
Raw lines 58 to 65
66### Task 3 Verification (Valuation)
67- [ ] Task 3 complete? (Valuation tabs added to model)
68- [ ] DCF sensitivity matrix exists? (for chart 28 ⭐)
69- [ ] DCF calculation details available? (for chart 29)
70- [ ] Comparable companies data collected? (for charts 30, 31)
71- [ ] Valuation ranges calculated? (for chart 32 ⭐)

Task 3 Verification (Valuation)

  • [ ] Task 3 complete? (Valuation tabs added to model)
  • [ ] DCF sensitivity matrix exists? (for chart 28 ⭐)
  • [ ] DCF calculation details available? (for chart 29)
  • [ ] Comparable companies data collected? (for charts 30, 31)
  • [ ] Valuation ranges calculated? (for chart 32 ⭐)
Raw lines 66 to 72
73### External Data Verification
74- [ ] Can access historical stock price data? (Yahoo Finance, Bloomberg for chart 01)
75- [ ] Can access historical valuation data? (Optional, for chart 34)
77**IF ANY VERIFICATION FAILS**:
78- Missing Task 1? → Complete Task 1 (Company Research) first
79- Missing Task 2? → Complete Task 2 (Financial Modeling) first
80- Missing Task 3? → Complete Task 3 (Valuation Analysis) first
81- Missing external data? → Gather from Yahoo Finance, Bloomberg, or similar sources
83---

External Data Verification

  • [ ] Can access historical stock price data? (Yahoo Finance, Bloomberg for chart 01)
  • [ ] Can access historical valuation data? (Optional, for chart 34)

IF ANY VERIFICATION FAILS:

  • Missing Task 1? → Complete Task 1 (Company Research) first
  • Missing Task 2? → Complete Task 2 (Financial Modeling) first
  • Missing Task 3? → Complete Task 3 (Valuation Analysis) first
  • Missing external data? → Gather from Yahoo Finance, Bloomberg, or similar sources

Raw lines 73 to 84
85## Chart Requirements: 25 Required + 10 Optional
87**IMPORTANT**: Task 5 (Report Assembly) will embed **ALL charts created** throughout the report. The report requires dense visual content (1 chart every 200-300 words), so create comprehensive chart coverage.

Chart Requirements: 25 Required + 10 Optional

IMPORTANT: Task 5 (Report Assembly) will embed ALL charts created throughout the report. The report requires dense visual content (1 chart every 200-300 words), so create comprehensive chart coverage.

Raw lines 85 to 88
89### 4 MANDATORY Charts (Non-Negotiable) ⭐
91These 4 charts are critical visualizations that MUST be present:
931. **chart_03**: Revenue by Product/Segment - Stacked Area Chart ⭐
942. **chart_04**: Revenue by Geography - Stacked Bar Chart ⭐
953. **chart_28**: DCF Sensitivity Analysis - 2-Way Heatmap ⭐
964. **chart_32**: Valuation Football Field - Horizontal Bar Chart ⭐

4 MANDATORY Charts (Non-Negotiable) ⭐

These 4 charts are critical visualizations that MUST be present:

  1. chart_03: Revenue by Product/Segment - Stacked Area Chart ⭐
  2. chart_04: Revenue by Geography - Stacked Bar Chart ⭐
  3. chart_28: DCF Sensitivity Analysis - 2-Way Heatmap ⭐
  4. chart_32: Valuation Football Field - Horizontal Bar Chart ⭐
Raw lines 89 to 97
98### 25 REQUIRED Charts (Complete Set)
100Create all 25 of these charts. Each has a specific purpose in Task 5:
102**Investment Summary Section (1 chart):**
103- chart_01: Stock Price Performance (12-24 months)
105**Financial Performance Section (6 charts):**
106- chart_02: Revenue Growth Trajectory
107- chart_03: Revenue by Product - Stacked Area ⭐ MANDATORY
108- chart_04: Revenue by Geography - Stacked Bar ⭐ MANDATORY
109- chart_10: Gross Margin Evolution
110- chart_11: EBITDA Margin Progression
111- chart_12: Free Cash Flow Trend
113**Company 101 Section (7 charts):**
114- chart_05: Company Overview/Timeline
115- chart_06: Key Milestones Timeline
116- chart_07: Organizational Structure
117- chart_08: Product Portfolio Overview
118- chart_09: Customer Segmentation
119- chart_15: Market Size Evolution (TAM)
120- chart_16: Competitive Positioning Matrix
122**Competitive & Market Section (2 charts):**
123- chart_17: Market Share Breakdown
124- chart_18: Competitive Benchmarking
126**Scenario Analysis Section (2 charts):**
127- chart_13: Operating Metrics Dashboard
128- chart_14: Scenario Comparison (Bull/Base/Bear)
130**Valuation Section (7 charts):**
131- chart_28: DCF Sensitivity Heatmap ⭐ MANDATORY
132- chart_29: DCF Valuation Waterfall
133- chart_30: Trading Comps Scatter Plot
134- chart_31: Peer Multiples Comparison
135- chart_32: Valuation Football Field ⭐ MANDATORY
136- chart_33: Price Target Scenarios
137- chart_34: Historical Valuation Multiples
139**Total: 25 Required Charts**

25 REQUIRED Charts (Complete Set)

Create all 25 of these charts. Each has a specific purpose in Task 5:

Investment Summary Section (1 chart):

  • chart_01: Stock Price Performance (12-24 months)

Financial Performance Section (6 charts):

  • chart_02: Revenue Growth Trajectory
  • chart_03: Revenue by Product - Stacked Area ⭐ MANDATORY
  • chart_04: Revenue by Geography - Stacked Bar ⭐ MANDATORY
  • chart_10: Gross Margin Evolution
  • chart_11: EBITDA Margin Progression
  • chart_12: Free Cash Flow Trend

Company 101 Section (7 charts):

  • chart_05: Company Overview/Timeline
  • chart_06: Key Milestones Timeline
  • chart_07: Organizational Structure
  • chart_08: Product Portfolio Overview
  • chart_09: Customer Segmentation
  • chart_15: Market Size Evolution (TAM)
  • chart_16: Competitive Positioning Matrix

Competitive & Market Section (2 charts):

  • chart_17: Market Share Breakdown
  • chart_18: Competitive Benchmarking

Scenario Analysis Section (2 charts):

  • chart_13: Operating Metrics Dashboard
  • chart_14: Scenario Comparison (Bull/Base/Bear)

Valuation Section (7 charts):

  • chart_28: DCF Sensitivity Heatmap ⭐ MANDATORY
  • chart_29: DCF Valuation Waterfall
  • chart_30: Trading Comps Scatter Plot
  • chart_31: Peer Multiples Comparison
  • chart_32: Valuation Football Field ⭐ MANDATORY
  • chart_33: Price Target Scenarios
  • chart_34: Historical Valuation Multiples

Total: 25 Required Charts

Raw lines 98 to 140
141### 10 OPTIONAL Charts (For 30-35 Range)
143Add these for greater visual density and storytelling (reach 26-35 total):
145- chart_19: Customer Acquisition Trends
146- chart_20: Unit Economics Evolution
147- chart_21: Product Roadmap Timeline
148- chart_22: Geographic Expansion Map
149- chart_23: R&D Investment Trends
150- chart_24: Sales & Marketing Efficiency
151- chart_25: Working Capital Trends
152- chart_26: Debt Maturity Schedule
153- chart_27: Ownership Structure
154- chart_35: Analyst Price Target Distribution
156**Total Range: 25-35 Charts (25 required + 0-10 optional)**
158---

10 OPTIONAL Charts (For 30-35 Range)

Add these for greater visual density and storytelling (reach 26-35 total):

  • chart_19: Customer Acquisition Trends
  • chart_20: Unit Economics Evolution
  • chart_21: Product Roadmap Timeline
  • chart_22: Geographic Expansion Map
  • chart_23: R&D Investment Trends
  • chart_24: Sales & Marketing Efficiency
  • chart_25: Working Capital Trends
  • chart_26: Debt Maturity Schedule
  • chart_27: Ownership Structure
  • chart_35: Analyst Price Target Distribution

Total Range: 25-35 Charts (25 required + 0-10 optional)


Raw lines 141 to 159
160## Data Source Mapping for Required Charts
162Understanding where each chart's data comes from:

Data Source Mapping for Required Charts

Understanding where each chart's data comes from:

Raw lines 160 to 163
164### From Task 1 (Company Research) - 9 charts
165- chart_05: Company Overview → Task 1: Company Overview section
166- chart_06: Key Milestones → Task 1: Company History section
167- chart_07: Org Structure → Task 1: Management Team section
168- chart_08: Product Portfolio → Task 1: Products & Services section
169- chart_09: Customer Segmentation → Task 1: Customers & Go-to-Market section
170- chart_15: Market Size Evolution → Task 1: Market Opportunity (TAM) section
171- chart_16: Competitive Positioning → Task 1: Competitive Landscape section
172- chart_17: Market Share → Task 1: Competitive Landscape section
173- chart_18: Competitive Benchmarking → Task 1: Competitive Landscape section

From Task 1 (Company Research) - 9 charts

  • chart_05: Company Overview → Task 1: Company Overview section
  • chart_06: Key Milestones → Task 1: Company History section
  • chart_07: Org Structure → Task 1: Management Team section
  • chart_08: Product Portfolio → Task 1: Products & Services section
  • chart_09: Customer Segmentation → Task 1: Customers & Go-to-Market section
  • chart_15: Market Size Evolution → Task 1: Market Opportunity (TAM) section
  • chart_16: Competitive Positioning → Task 1: Competitive Landscape section
  • chart_17: Market Share → Task 1: Competitive Landscape section
  • chart_18: Competitive Benchmarking → Task 1: Competitive Landscape section
Raw lines 164 to 174
175### From Task 2 (Financial Model) - 8 charts
176- chart_02: Revenue Growth → Income Statement tab (Revenue row)
177- chart_03: Revenue by Product ⭐ → Revenue Model tab (Product breakdown)
178- chart_04: Revenue by Geography ⭐ → Revenue Model tab (Geography breakdown)
179- chart_10: Gross Margin → Income Statement tab (Gross Profit / Revenue)
180- chart_11: EBITDA Margin → Income Statement tab (EBITDA / Revenue)
181- chart_12: Free Cash Flow → Cash Flow Statement tab (CFO - CapEx)
182- chart_13: Operating Metrics → Multiple tabs (Income Statement, Cash Flow)
183- chart_14: Scenario Comparison → Scenarios tab (Bull/Base/Bear)

From Task 2 (Financial Model) - 8 charts

  • chart_02: Revenue Growth → Income Statement tab (Revenue row)
  • chart_03: Revenue by Product ⭐ → Revenue Model tab (Product breakdown)
  • chart_04: Revenue by Geography ⭐ → Revenue Model tab (Geography breakdown)
  • chart_10: Gross Margin → Income Statement tab (Gross Profit / Revenue)
  • chart_11: EBITDA Margin → Income Statement tab (EBITDA / Revenue)
  • chart_12: Free Cash Flow → Cash Flow Statement tab (CFO - CapEx)
  • chart_13: Operating Metrics → Multiple tabs (Income Statement, Cash Flow)
  • chart_14: Scenario Comparison → Scenarios tab (Bull/Base/Bear)
Raw lines 175 to 184
185### From Task 3 (Valuation) - 6 charts
186- chart_28: DCF Sensitivity ⭐ → Sensitivity Analysis tab
187- chart_29: DCF Waterfall → DCF tab (Enterprise Value components)
188- chart_30: Trading Comps Scatter → Comparable Companies tab
189- chart_31: Peer Multiples → Comparable Companies tab
190- chart_32: Valuation Football Field ⭐ → Valuation Summary tab
191- chart_33: Price Target Scenarios → Valuation Summary tab (or calculate from scenarios)

From Task 3 (Valuation) - 6 charts

  • chart_28: DCF Sensitivity ⭐ → Sensitivity Analysis tab
  • chart_29: DCF Waterfall → DCF tab (Enterprise Value components)
  • chart_30: Trading Comps Scatter → Comparable Companies tab
  • chart_31: Peer Multiples → Comparable Companies tab
  • chart_32: Valuation Football Field ⭐ → Valuation Summary tab
  • chart_33: Price Target Scenarios → Valuation Summary tab (or calculate from scenarios)
Raw lines 185 to 192
193### From External Sources - 2 charts
194- chart_01: Stock Price Performance → Yahoo Finance, Bloomberg, Alpha Vantage
195- chart_34: Historical Valuation Multiples → Yahoo Finance, Bloomberg (historical P/E, EV/EBITDA)
197**IMPORTANT**: Require ALL three tasks (1, 2, 3) complete PLUS external data access to create all 25 required charts.
199---

From External Sources - 2 charts

  • chart_01: Stock Price Performance → Yahoo Finance, Bloomberg, Alpha Vantage
  • chart_34: Historical Valuation Multiples → Yahoo Finance, Bloomberg (historical P/E, EV/EBITDA)

IMPORTANT: Require ALL three tasks (1, 2, 3) complete PLUS external data access to create all 25 required charts.


Raw lines 193 to 200
201## Step-by-Step Chart Generation Workflow

Step-by-Step Chart Generation Workflow

Raw lines 201 to 202
203### Step 1: Set Up Environment
205**Install required libraries:**
206```bash
207pip install matplotlib seaborn pandas numpy plotly
208```
210**Create Python script header:**
211```python
212import matplotlib.pyplot as plt
213import seaborn as sns
214import pandas as pd
215import numpy as np
216from matplotlib.patches import Rectangle
217import warnings
218warnings.filterwarnings('ignore')
220# Set global style
221plt.style.use('seaborn-v0_8-darkgrid')
222sns.set_palette("husl")
224# Global settings
225DPI = 300
226FIGURE_WIDTH = 10
227FIGURE_HEIGHT = 6
228TITLE_FONT_SIZE = 14
229AXIS_FONT_SIZE = 12
230LABEL_FONT_SIZE = 10
231```

Step 1: Set Up Environment

Install required libraries:

pip install matplotlib seaborn pandas numpy plotly

Create Python script header:

import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from matplotlib.patches import Rectangle
import warnings
warnings.filterwarnings('ignore')

# Set global style
plt.style.use('seaborn-v0_8-darkgrid')
sns.set_palette("husl")

# Global settings
DPI = 300
FIGURE_WIDTH = 10
FIGURE_HEIGHT = 6
TITLE_FONT_SIZE = 14
AXIS_FONT_SIZE = 12
LABEL_FONT_SIZE = 10
Raw lines 203 to 232
233### Step 2: Extract Data from Model and Valuation
235#### A. Extract Revenue Data
236```python
237# Revenue by Product (from Task 2 model)
238years = [2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029]
240# Extract from Excel or define manually from model
241product_a = [100, 120, 145, 175, 210, 252, 302, 363, 435, 522]
242product_b = [80, 95, 115, 138, 165, 198, 238, 285, 342, 411]
243product_c = [50, 62, 78, 98, 122, 153, 191, 239, 299, 374]
244product_d = [30, 38, 48, 61, 77, 97, 122, 153, 191, 239]
246# Revenue by Geography
247north_america = [150, 180, 220, 265, 320, 384, 461, 553, 664, 797]
248europe = [80, 95, 115, 140, 170, 204, 245, 294, 353, 423]
249asia_pacific = [40, 50, 63, 80, 101, 127, 159, 199, 249, 311]
250rest_of_world = [20, 25, 32, 40, 51, 64, 80, 100, 125, 156]
251```
253#### B. Extract Margin Data
254```python
255# Margin evolution
256gross_margin = [58.0, 59.2, 60.5, 61.8, 63.0, 64.5, 66.0, 67.0, 67.5, 68.0]
257ebitda_margin = [12.0, 15.5, 18.8, 22.0, 25.0, 28.0, 30.5, 32.0, 33.0, 34.0]
258fcf_margin = [8.0, 11.0, 14.5, 18.0, 21.0, 24.0, 26.5, 28.0, 29.0, 30.0]
259```
261#### C. Extract DCF Sensitivity Data
262```python
263# DCF Sensitivity (from Task 3 valuation)
264wacc_values = [7.0, 8.0, 9.0, 10.0, 11.0, 12.0]
265terminal_growth = [1.5, 2.0, 2.5, 3.0, 3.5]
267# Price per share matrix (rows = WACC, columns = terminal growth)
268dcf_sensitivity = np.array([
269 [66, 71, 76, 82, 89],
270 [58, 62, 67, 72, 78],
271 [52, 55, 59, 63, 68],
272 [47, 50, 53, 56, 60],
273 [42, 45, 48, 51, 54],
274 [39, 41, 44, 46, 49]
275])
276```
278#### D. Extract Valuation Ranges
279```python
280# Valuation Football Field (from Task 3)
281valuation_methods = ['DCF Analysis', 'Trading Comps\n(NTM)', 'Precedent\nTransactions']
282valuation_low = [48, 45, 52]
283valuation_high = [62, 57, 66]
284current_price = 50
285target_price = 55
286```

Step 2: Extract Data from Model and Valuation

A. Extract Revenue Data

# Revenue by Product (from Task 2 model)
years = [2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029]

# Extract from Excel or define manually from model
product_a = [100, 120, 145, 175, 210, 252, 302, 363, 435, 522]
product_b = [80, 95, 115, 138, 165, 198, 238, 285, 342, 411]
product_c = [50, 62, 78, 98, 122, 153, 191, 239, 299, 374]
product_d = [30, 38, 48, 61, 77, 97, 122, 153, 191, 239]

# Revenue by Geography
north_america = [150, 180, 220, 265, 320, 384, 461, 553, 664, 797]
europe = [80, 95, 115, 140, 170, 204, 245, 294, 353, 423]
asia_pacific = [40, 50, 63, 80, 101, 127, 159, 199, 249, 311]
rest_of_world = [20, 25, 32, 40, 51, 64, 80, 100, 125, 156]

B. Extract Margin Data

# Margin evolution
gross_margin = [58.0, 59.2, 60.5, 61.8, 63.0, 64.5, 66.0, 67.0, 67.5, 68.0]
ebitda_margin = [12.0, 15.5, 18.8, 22.0, 25.0, 28.0, 30.5, 32.0, 33.0, 34.0]
fcf_margin = [8.0, 11.0, 14.5, 18.0, 21.0, 24.0, 26.5, 28.0, 29.0, 30.0]

C. Extract DCF Sensitivity Data

# DCF Sensitivity (from Task 3 valuation)
wacc_values = [7.0, 8.0, 9.0, 10.0, 11.0, 12.0]
terminal_growth = [1.5, 2.0, 2.5, 3.0, 3.5]

# Price per share matrix (rows = WACC, columns = terminal growth)
dcf_sensitivity = np.array([
    [66, 71, 76, 82, 89],
    [58, 62, 67, 72, 78],
    [52, 55, 59, 63, 68],
    [47, 50, 53, 56, 60],
    [42, 45, 48, 51, 54],
    [39, 41, 44, 46, 49]
])

D. Extract Valuation Ranges

# Valuation Football Field (from Task 3)
valuation_methods = ['DCF Analysis', 'Trading Comps\n(NTM)', 'Precedent\nTransactions']
valuation_low = [48, 45, 52]
valuation_high = [62, 57, 66]
current_price = 50
target_price = 55
Raw lines 233 to 287
288### Step 3: Create Mandatory Charts
290#### Chart 1: Revenue by Product - Stacked Area ⭐ MANDATORY
292```python
293def create_revenue_by_product_chart():
294 """Create revenue by product stacked area chart"""
296 fig, ax = plt.subplots(figsize=(10, 6))
298 # Create stacked area chart
299 ax.stackplot(years, product_a, product_b, product_c, product_d,
300 labels=['Product A', 'Product B', 'Product C', 'Product D'],
301 colors=['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728'],
302 alpha=0.8)
304 # Formatting
305 ax.set_xlabel('Year', fontsize=12, fontweight='bold')
306 ax.set_ylabel('Revenue ($M)', fontsize=12, fontweight='bold')
307 ax.set_title('Figure 3 - Revenue by Product/Segment (2020-2029E)',
308 fontsize=14, fontweight='bold', pad=20)
310 # Legend
311 ax.legend(loc='upper left', frameon=False, fontsize=10)
313 # Grid
314 ax.grid(axis='y', alpha=0.3, linestyle='--')
315 ax.set_axisbelow(True)
317 # Remove top and right spines
318 ax.spines['top'].set_visible(False)
319 ax.spines['right'].set_visible(False)
321 # Add vertical line to separate historical from projected
322 ax.axvline(x=2024, color='gray', linestyle='--', linewidth=1, alpha=0.5)
323 ax.text(2024.2, ax.get_ylim()[1]*0.95, 'Projected →',
324 fontsize=9, color='gray', ha='left')
326 # Source line
327 fig.text(0.12, 0.02, 'Source: Company data, [Firm] estimates',
328 fontsize=9, style='italic', color='gray')
330 # Save
331 plt.tight_layout()
332 plt.savefig('chart_03_revenue_by_product_stacked_area.png',
333 dpi=300, bbox_inches='tight', facecolor='white')
334 plt.close()
335 print("✓ Created: chart_03_revenue_by_product_stacked_area.png")
337create_revenue_by_product_chart()
338```
340#### Chart 2: Revenue by Geography - Stacked Bar ⭐ MANDATORY
342```python
343def create_revenue_by_geography_chart():
344 """Create revenue by geography stacked bar chart"""
346 years_labels = ['2020', '2021', '2022', '2023', '2024',
347 '2025E', '2026E', '2027E', '2028E', '2029E']
349 fig, ax = plt.subplots(figsize=(10, 6))
351 # Create stacked bar chart
352 width = 0.6
353 x = np.arange(len(years_labels))
355 p1 = ax.bar(x, north_america, width, label='North America', color='#1f77b4')
356 p2 = ax.bar(x, europe, width, bottom=north_america,
357 label='Europe', color='#ff7f0e')
358 p3 = ax.bar(x, asia_pacific, width,
359 bottom=np.array(north_america) + np.array(europe),
360 label='Asia-Pacific', color='#2ca02c')
361 p4 = ax.bar(x, rest_of_world, width,
362 bottom=np.array(north_america) + np.array(europe) + np.array(asia_pacific),
363 label='Rest of World', color='#d62728')
365 # Formatting
366 ax.set_xlabel('Year', fontsize=12, fontweight='bold')
367 ax.set_ylabel('Revenue ($M)', fontsize=12, fontweight='bold')
368 ax.set_title('Figure 4 - Revenue by Geography (2020-2029E)',
369 fontsize=14, fontweight='bold', pad=20)
370 ax.set_xticks(x)
371 ax.set_xticklabels(years_labels, rotation=45, ha='right')
373 # Legend
374 ax.legend(loc='upper left', frameon=False, fontsize=10)
376 # Grid
377 ax.grid(axis='y', alpha=0.3, linestyle='--')
378 ax.set_axisbelow(True)
380 # Remove top and right spines
381 ax.spines['top'].set_visible(False)
382 ax.spines['right'].set_visible(False)
384 # Source line
385 fig.text(0.12, 0.02, 'Source: Company data, [Firm] estimates',
386 fontsize=9, style='italic', color='gray')
388 # Save
389 plt.tight_layout()
390 plt.savefig('chart_04_revenue_by_geography_stacked_bar.png',
391 dpi=300, bbox_inches='tight', facecolor='white')
392 plt.close()
393 print("✓ Created: chart_04_revenue_by_geography_stacked_bar.png")
395create_revenue_by_geography_chart()
396```
398#### Chart 3: DCF Sensitivity - Heatmap ⭐ MANDATORY
400```python
401def create_dcf_sensitivity_heatmap():
402 """Create DCF sensitivity analysis heatmap"""
404 # Create DataFrame
405 df = pd.DataFrame(dcf_sensitivity,
406 index=[f'{w}%' for w in wacc_values],
407 columns=[f'{g}%' for g in terminal_growth])
409 fig, ax = plt.subplots(figsize=(8, 6))
411 # Create heatmap
412 sns.heatmap(df, annot=True, fmt='d', cmap='RdYlGn',
413 cbar_kws={'label': 'Price per Share ($)'},
414 linewidths=0.5, linecolor='white',
415 ax=ax, vmin=35, vmax=95)
417 # Formatting
418 ax.set_xlabel('Terminal Growth Rate', fontsize=12, fontweight='bold')
419 ax.set_ylabel('WACC', fontsize=12, fontweight='bold')
420 ax.set_title('Figure 28 - DCF Sensitivity Analysis ($/share)',
421 fontsize=14, fontweight='bold', pad=20)
423 # Rotate y-axis labels
424 plt.yticks(rotation=0)
426 # Source line
427 fig.text(0.12, 0.02, 'Source: [Firm] estimates',
428 fontsize=9, style='italic', color='gray')
430 # Save
431 plt.tight_layout()
432 plt.savefig('chart_28_dcf_sensitivity_heatmap.png',
433 dpi=300, bbox_inches='tight', facecolor='white')
434 plt.close()
435 print("✓ Created: chart_28_dcf_sensitivity_heatmap.png")
437create_dcf_sensitivity_heatmap()
438```
440#### Chart 4: Valuation Football Field ⭐ MANDATORY
442```python
443def create_valuation_football_field():
444 """Create valuation football field chart"""
446 fig, ax = plt.subplots(figsize=(10, 5))
448 # Create horizontal bars
449 y_positions = np.arange(len(valuation_methods))
450 colors = ['#1f77b4', '#ff7f0e', '#2ca02c']
452 for i, (method, low, high, color) in enumerate(
453 zip(valuation_methods, valuation_low, valuation_high, colors)):
454 ax.barh(i, high - low, left=low, height=0.6,
455 color=color, alpha=0.7, label=method)
457 # Add value labels at ends
458 ax.text(low - 1, i, f'${low}', va='center', ha='right', fontsize=10)
459 ax.text(high + 1, i, f'${high}', va='center', ha='left', fontsize=10)
461 # Add current price line
462 ax.axvline(x=current_price, color='red', linestyle='--', linewidth=2,
463 label=f'Current: ${current_price}', alpha=0.7)
465 # Add target price line
466 ax.axvline(x=target_price, color='black', linestyle='-', linewidth=2,
467 label=f'Target: ${target_price}')
469 # Formatting
470 ax.set_yticks(y_positions)
471 ax.set_yticklabels(valuation_methods, fontsize=11)
472 ax.set_xlabel('Price Per Share ($)', fontsize=12, fontweight='bold')
473 ax.set_title('Figure 32 - Valuation Football Field',
474 fontsize=14, fontweight='bold', pad=20)
476 # Set x-axis limits
477 ax.set_xlim(40, 70)
479 # Remove spines
480 ax.spines['top'].set_visible(False)
481 ax.spines['right'].set_visible(False)
482 ax.spines['left'].set_visible(False)
484 # Grid
485 ax.grid(axis='x', alpha=0.3, linestyle='--')
486 ax.set_axisbelow(True)
488 # Legend
489 ax.legend(loc='upper right', frameon=False, fontsize=9)
491 # Source line
492 fig.text(0.12, 0.02, 'Source: [Firm] estimates',
493 fontsize=9, style='italic', color='gray')
495 # Save
496 plt.tight_layout()
497 plt.savefig('chart_32_valuation_football_field.png',
498 dpi=300, bbox_inches='tight', facecolor='white')
499 plt.close()
500 print("✓ Created: chart_32_valuation_football_field.png")
502create_valuation_football_field()
503```

Step 3: Create Mandatory Charts

Chart 1: Revenue by Product - Stacked Area ⭐ MANDATORY

def create_revenue_by_product_chart():
    """Create revenue by product stacked area chart"""

    fig, ax = plt.subplots(figsize=(10, 6))

    # Create stacked area chart
    ax.stackplot(years, product_a, product_b, product_c, product_d,
                 labels=['Product A', 'Product B', 'Product C', 'Product D'],
                 colors=['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728'],
                 alpha=0.8)

    # Formatting
    ax.set_xlabel('Year', fontsize=12, fontweight='bold')
    ax.set_ylabel('Revenue ($M)', fontsize=12, fontweight='bold')
    ax.set_title('Figure 3 - Revenue by Product/Segment (2020-2029E)',
                 fontsize=14, fontweight='bold', pad=20)

    # Legend
    ax.legend(loc='upper left', frameon=False, fontsize=10)

    # Grid
    ax.grid(axis='y', alpha=0.3, linestyle='--')
    ax.set_axisbelow(True)

    # Remove top and right spines
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)

    # Add vertical line to separate historical from projected
    ax.axvline(x=2024, color='gray', linestyle='--', linewidth=1, alpha=0.5)
    ax.text(2024.2, ax.get_ylim()[1]*0.95, 'Projected →',
            fontsize=9, color='gray', ha='left')

    # Source line
    fig.text(0.12, 0.02, 'Source: Company data, [Firm] estimates',
             fontsize=9, style='italic', color='gray')

    # Save
    plt.tight_layout()
    plt.savefig('chart_03_revenue_by_product_stacked_area.png',
                dpi=300, bbox_inches='tight', facecolor='white')
    plt.close()
    print("✓ Created: chart_03_revenue_by_product_stacked_area.png")

create_revenue_by_product_chart()

Chart 2: Revenue by Geography - Stacked Bar ⭐ MANDATORY

def create_revenue_by_geography_chart():
    """Create revenue by geography stacked bar chart"""

    years_labels = ['2020', '2021', '2022', '2023', '2024',
                    '2025E', '2026E', '2027E', '2028E', '2029E']

    fig, ax = plt.subplots(figsize=(10, 6))

    # Create stacked bar chart
    width = 0.6
    x = np.arange(len(years_labels))

    p1 = ax.bar(x, north_america, width, label='North America', color='#1f77b4')
    p2 = ax.bar(x, europe, width, bottom=north_america,
                label='Europe', color='#ff7f0e')
    p3 = ax.bar(x, asia_pacific, width,
                bottom=np.array(north_america) + np.array(europe),
                label='Asia-Pacific', color='#2ca02c')
    p4 = ax.bar(x, rest_of_world, width,
                bottom=np.array(north_america) + np.array(europe) + np.array(asia_pacific),
                label='Rest of World', color='#d62728')

    # Formatting
    ax.set_xlabel('Year', fontsize=12, fontweight='bold')
    ax.set_ylabel('Revenue ($M)', fontsize=12, fontweight='bold')
    ax.set_title('Figure 4 - Revenue by Geography (2020-2029E)',
                 fontsize=14, fontweight='bold', pad=20)
    ax.set_xticks(x)
    ax.set_xticklabels(years_labels, rotation=45, ha='right')

    # Legend
    ax.legend(loc='upper left', frameon=False, fontsize=10)

    # Grid
    ax.grid(axis='y', alpha=0.3, linestyle='--')
    ax.set_axisbelow(True)

    # Remove top and right spines
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)

    # Source line
    fig.text(0.12, 0.02, 'Source: Company data, [Firm] estimates',
             fontsize=9, style='italic', color='gray')

    # Save
    plt.tight_layout()
    plt.savefig('chart_04_revenue_by_geography_stacked_bar.png',
                dpi=300, bbox_inches='tight', facecolor='white')
    plt.close()
    print("✓ Created: chart_04_revenue_by_geography_stacked_bar.png")

create_revenue_by_geography_chart()

Chart 3: DCF Sensitivity - Heatmap ⭐ MANDATORY

def create_dcf_sensitivity_heatmap():
    """Create DCF sensitivity analysis heatmap"""

    # Create DataFrame
    df = pd.DataFrame(dcf_sensitivity,
                      index=[f'{w}%' for w in wacc_values],
                      columns=[f'{g}%' for g in terminal_growth])

    fig, ax = plt.subplots(figsize=(8, 6))

    # Create heatmap
    sns.heatmap(df, annot=True, fmt='d', cmap='RdYlGn',
                cbar_kws={'label': 'Price per Share ($)'},
                linewidths=0.5, linecolor='white',
                ax=ax, vmin=35, vmax=95)

    # Formatting
    ax.set_xlabel('Terminal Growth Rate', fontsize=12, fontweight='bold')
    ax.set_ylabel('WACC', fontsize=12, fontweight='bold')
    ax.set_title('Figure 28 - DCF Sensitivity Analysis ($/share)',
                 fontsize=14, fontweight='bold', pad=20)

    # Rotate y-axis labels
    plt.yticks(rotation=0)

    # Source line
    fig.text(0.12, 0.02, 'Source: [Firm] estimates',
             fontsize=9, style='italic', color='gray')

    # Save
    plt.tight_layout()
    plt.savefig('chart_28_dcf_sensitivity_heatmap.png',
                dpi=300, bbox_inches='tight', facecolor='white')
    plt.close()
    print("✓ Created: chart_28_dcf_sensitivity_heatmap.png")

create_dcf_sensitivity_heatmap()

Chart 4: Valuation Football Field ⭐ MANDATORY

def create_valuation_football_field():
    """Create valuation football field chart"""

    fig, ax = plt.subplots(figsize=(10, 5))

    # Create horizontal bars
    y_positions = np.arange(len(valuation_methods))
    colors = ['#1f77b4', '#ff7f0e', '#2ca02c']

    for i, (method, low, high, color) in enumerate(
            zip(valuation_methods, valuation_low, valuation_high, colors)):
        ax.barh(i, high - low, left=low, height=0.6,
                color=color, alpha=0.7, label=method)

        # Add value labels at ends
        ax.text(low - 1, i, f'${low}', va='center', ha='right', fontsize=10)
        ax.text(high + 1, i, f'${high}', va='center', ha='left', fontsize=10)

    # Add current price line
    ax.axvline(x=current_price, color='red', linestyle='--', linewidth=2,
               label=f'Current: ${current_price}', alpha=0.7)

    # Add target price line
    ax.axvline(x=target_price, color='black', linestyle='-', linewidth=2,
               label=f'Target: ${target_price}')

    # Formatting
    ax.set_yticks(y_positions)
    ax.set_yticklabels(valuation_methods, fontsize=11)
    ax.set_xlabel('Price Per Share ($)', fontsize=12, fontweight='bold')
    ax.set_title('Figure 32 - Valuation Football Field',
                 fontsize=14, fontweight='bold', pad=20)

    # Set x-axis limits
    ax.set_xlim(40, 70)

    # Remove spines
    ax.spines['top'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['left'].set_visible(False)

    # Grid
    ax.grid(axis='x', alpha=0.3, linestyle='--')
    ax.set_axisbelow(True)

    # Legend
    ax.legend(loc='upper right', frameon=False, fontsize=9)

    # Source line
    fig.text(0.12, 0.02, 'Source: [Firm] estimates',
             fontsize=9, style='italic', color='gray')

    # Save
    plt.tight_layout()
    plt.savefig('chart_32_valuation_football_field.png',
                dpi=300, bbox_inches='tight', facecolor='white')
    plt.close()
    print("✓ Created: chart_32_valuation_football_field.png")

create_valuation_football_field()
Raw lines 288 to 504
505### Step 4: Create Remaining Required Charts (Charts 1-34)
507**Complete the 25 REQUIRED charts** by creating all remaining charts from the required list. Each chart has a specific purpose in Task 5.
509#### Investment Summary (1 chart)
510```python
511# chart_01: Stock Price Performance (12-24 months)
512# - Line chart showing stock price over time vs. market index
513# - Used on Page 1 of final report
514```
516#### Financial Performance (5 additional charts beyond chart_03 and chart_04)
517```python
518# chart_02: Revenue Growth Trajectory
519# chart_10: Gross Margin Evolution
520# chart_11: EBITDA Margin Progression
521# chart_12: Free Cash Flow Trend
522# chart_14: Scenario Comparison (Bull/Base/Bear)
523```
525#### Company 101 Section (7 charts)
526```python
527# chart_05: Company Overview/Timeline
528# chart_06: Key Milestones Timeline
529# chart_07: Organizational Structure
530# chart_08: Product Portfolio Overview
531# chart_09: Customer Segmentation
532# chart_15: Market Size Evolution (TAM)
533# chart_16: Competitive Positioning Matrix
534```
536#### Competitive & Market (2 charts)
537```python
538# chart_17: Market Share Breakdown
539# chart_18: Competitive Benchmarking
540```
542#### Scenario Analysis (1 chart)
543```python
544# chart_13: Operating Metrics Dashboard
545```
547#### Valuation Section (6 additional charts beyond chart_28 and chart_32)
548```python
549# chart_29: DCF Valuation Waterfall
550# chart_30: Trading Comps Scatter Plot
551# chart_31: Peer Multiples Comparison
552# chart_33: Price Target Scenarios
553# chart_34: Historical Valuation Multiples
554```
556**Use consistent formatting across all charts:**
557- 300 DPI resolution
558- Professional color scheme
559- Clear labels, legends, and titles
560- Figure numbers (e.g., "Figure 5 - Company Timeline")
561- Source citations at bottom

Step 4: Create Remaining Required Charts (Charts 1-34)

Complete the 25 REQUIRED charts by creating all remaining charts from the required list. Each chart has a specific purpose in Task 5.

Investment Summary (1 chart)

# chart_01: Stock Price Performance (12-24 months)
# - Line chart showing stock price over time vs. market index
# - Used on Page 1 of final report

Financial Performance (5 additional charts beyond chart_03 and chart_04)

# chart_02: Revenue Growth Trajectory
# chart_10: Gross Margin Evolution
# chart_11: EBITDA Margin Progression
# chart_12: Free Cash Flow Trend
# chart_14: Scenario Comparison (Bull/Base/Bear)

Company 101 Section (7 charts)

# chart_05: Company Overview/Timeline
# chart_06: Key Milestones Timeline
# chart_07: Organizational Structure
# chart_08: Product Portfolio Overview
# chart_09: Customer Segmentation
# chart_15: Market Size Evolution (TAM)
# chart_16: Competitive Positioning Matrix

Competitive & Market (2 charts)

# chart_17: Market Share Breakdown
# chart_18: Competitive Benchmarking

Scenario Analysis (1 chart)

# chart_13: Operating Metrics Dashboard

Valuation Section (6 additional charts beyond chart_28 and chart_32)

# chart_29: DCF Valuation Waterfall
# chart_30: Trading Comps Scatter Plot
# chart_31: Peer Multiples Comparison
# chart_33: Price Target Scenarios
# chart_34: Historical Valuation Multiples

Use consistent formatting across all charts:

  • 300 DPI resolution
  • Professional color scheme
  • Clear labels, legends, and titles
  • Figure numbers (e.g., "Figure 5 - Company Timeline")
  • Source citations at bottom
Raw lines 505 to 562
563### Step 4B: Create Optional Charts (For 26-35 Total)
565**Optional**: Add 1-10 additional charts from this list for greater visual density:
567```python
568# chart_19: Customer Acquisition Trends
569# chart_20: Unit Economics Evolution
570# chart_21: Product Roadmap Timeline
571# chart_22: Geographic Expansion Map
572# chart_23: R&D Investment Trends
573# chart_24: Sales & Marketing Efficiency
574# chart_25: Working Capital Trends
575# chart_26: Debt Maturity Schedule
576# chart_27: Ownership Structure
577# chart_35: Analyst Price Target Distribution
578```
580These optional charts provide additional visual storytelling and help achieve the "1 chart per 200-300 words" density target in Task 5.

Step 4B: Create Optional Charts (For 26-35 Total)

Optional: Add 1-10 additional charts from this list for greater visual density:

# chart_19: Customer Acquisition Trends
# chart_20: Unit Economics Evolution
# chart_21: Product Roadmap Timeline
# chart_22: Geographic Expansion Map
# chart_23: R&D Investment Trends
# chart_24: Sales & Marketing Efficiency
# chart_25: Working Capital Trends
# chart_26: Debt Maturity Schedule
# chart_27: Ownership Structure
# chart_35: Analyst Price Target Distribution

These optional charts provide additional visual storytelling and help achieve the "1 chart per 200-300 words" density target in Task 5.

Raw lines 563 to 581
582### Step 5: Create Chart Index
584Create a text file documenting all charts:
586```python
587def create_chart_index():
588 """Create index of all charts"""
590 # 25 REQUIRED CHARTS
591 required_charts = [
592 "chart_01_stock_price_performance.png - Stock Price Performance (12-24M)",
593 "chart_02_revenue_growth_trajectory.png - Revenue Growth Trajectory",
594 "chart_03_revenue_by_product_stacked_area.png - Revenue by Product [MANDATORY]",
595 "chart_04_revenue_by_geography_stacked_bar.png - Revenue by Geography [MANDATORY]",
596 "chart_05_company_overview.png - Company Overview/Timeline",
597 "chart_06_key_milestones_timeline.png - Key Milestones Timeline",
598 "chart_07_organizational_structure.png - Organizational Structure",
599 "chart_08_product_portfolio.png - Product Portfolio Overview",
600 "chart_09_customer_segmentation.png - Customer Segmentation",
601 "chart_10_gross_margin_evolution.png - Gross Margin Evolution",
602 "chart_11_ebitda_margin_progression.png - EBITDA Margin Progression",
603 "chart_12_free_cash_flow_trend.png - Free Cash Flow Trend",
604 "chart_13_operating_metrics_dashboard.png - Operating Metrics Dashboard",
605 "chart_14_scenario_comparison.png - Scenario Comparison (Bull/Base/Bear)",
606 "chart_15_market_size_evolution.png - Market Size Evolution (TAM)",
607 "chart_16_competitive_positioning.png - Competitive Positioning Matrix",
608 "chart_17_market_share.png - Market Share Breakdown",
609 "chart_18_competitive_benchmarking.png - Competitive Benchmarking",
610 "chart_28_dcf_sensitivity_heatmap.png - DCF Sensitivity Heatmap [MANDATORY]",
611 "chart_29_dcf_waterfall.png - DCF Valuation Waterfall",
612 "chart_30_trading_comps_scatter.png - Trading Comps Scatter Plot",
613 "chart_31_peer_multiples_comparison.png - Peer Multiples Comparison",
614 "chart_32_valuation_football_field.png - Valuation Football Field [MANDATORY]",
615 "chart_33_price_target_scenarios.png - Price Target Scenarios",
616 "chart_34_historical_valuation_multiples.png - Historical Valuation Multiples",
617 ]
619 # 10 OPTIONAL CHARTS (for 26-35 range)
620 optional_charts = [
621 "chart_19_customer_acquisition_trends.png - Customer Acquisition Trends [OPTIONAL]",
622 "chart_20_unit_economics_evolution.png - Unit Economics Evolution [OPTIONAL]",
623 "chart_21_product_roadmap_timeline.png - Product Roadmap Timeline [OPTIONAL]",
624 "chart_22_geographic_expansion_map.png - Geographic Expansion Map [OPTIONAL]",
625 "chart_23_rd_investment_trends.png - R&D Investment Trends [OPTIONAL]",
626 "chart_24_sales_marketing_efficiency.png - Sales & Marketing Efficiency [OPTIONAL]",
627 "chart_25_working_capital_trends.png - Working Capital Trends [OPTIONAL]",
628 "chart_26_debt_maturity_schedule.png - Debt Maturity Schedule [OPTIONAL]",
629 "chart_27_ownership_structure.png - Ownership Structure [OPTIONAL]",
630 "chart_35_analyst_price_targets.png - Analyst Price Target Distribution [OPTIONAL]",
631 ]
633 with open('chart_index.txt', 'w') as f:
634 f.write("CHART INDEX FOR [COMPANY] EQUITY RESEARCH REPORT\n")
635 f.write("=" * 60 + "\n\n")
637 f.write("4 MANDATORY CHARTS (Must be present):\n")
638 f.write("- chart_03: Revenue by Product (Stacked Area) ⭐\n")
639 f.write("- chart_04: Revenue by Geography (Stacked Bar) ⭐\n")
640 f.write("- chart_28: DCF Sensitivity (Heatmap) ⭐\n")
641 f.write("- chart_32: Valuation Football Field ⭐\n\n")
643 f.write("25 REQUIRED CHARTS:\n")
644 for chart in required_charts:
645 f.write(f" {chart}\n")
647 f.write("\n10 OPTIONAL CHARTS (for 26-35 total):\n")
648 for chart in optional_charts:
649 f.write(f" {chart}\n")
651 f.write("\n" + "=" * 60 + "\n")
652 f.write("NOTE: Task 5 will embed ALL charts created (25-35) throughout\n")
653 f.write("the report for visual density (1 chart every 200-300 words).\n")
655 print("✓ Created: chart_index.txt")
657create_chart_index()
658```

Step 5: Create Chart Index

Create a text file documenting all charts:

def create_chart_index():
    """Create index of all charts"""

    # 25 REQUIRED CHARTS
    required_charts = [
        "chart_01_stock_price_performance.png - Stock Price Performance (12-24M)",
        "chart_02_revenue_growth_trajectory.png - Revenue Growth Trajectory",
        "chart_03_revenue_by_product_stacked_area.png - Revenue by Product [MANDATORY]",
        "chart_04_revenue_by_geography_stacked_bar.png - Revenue by Geography [MANDATORY]",
        "chart_05_company_overview.png - Company Overview/Timeline",
        "chart_06_key_milestones_timeline.png - Key Milestones Timeline",
        "chart_07_organizational_structure.png - Organizational Structure",
        "chart_08_product_portfolio.png - Product Portfolio Overview",
        "chart_09_customer_segmentation.png - Customer Segmentation",
        "chart_10_gross_margin_evolution.png - Gross Margin Evolution",
        "chart_11_ebitda_margin_progression.png - EBITDA Margin Progression",
        "chart_12_free_cash_flow_trend.png - Free Cash Flow Trend",
        "chart_13_operating_metrics_dashboard.png - Operating Metrics Dashboard",
        "chart_14_scenario_comparison.png - Scenario Comparison (Bull/Base/Bear)",
        "chart_15_market_size_evolution.png - Market Size Evolution (TAM)",
        "chart_16_competitive_positioning.png - Competitive Positioning Matrix",
        "chart_17_market_share.png - Market Share Breakdown",
        "chart_18_competitive_benchmarking.png - Competitive Benchmarking",
        "chart_28_dcf_sensitivity_heatmap.png - DCF Sensitivity Heatmap [MANDATORY]",
        "chart_29_dcf_waterfall.png - DCF Valuation Waterfall",
        "chart_30_trading_comps_scatter.png - Trading Comps Scatter Plot",
        "chart_31_peer_multiples_comparison.png - Peer Multiples Comparison",
        "chart_32_valuation_football_field.png - Valuation Football Field [MANDATORY]",
        "chart_33_price_target_scenarios.png - Price Target Scenarios",
        "chart_34_historical_valuation_multiples.png - Historical Valuation Multiples",
    ]

    # 10 OPTIONAL CHARTS (for 26-35 range)
    optional_charts = [
        "chart_19_customer_acquisition_trends.png - Customer Acquisition Trends [OPTIONAL]",
        "chart_20_unit_economics_evolution.png - Unit Economics Evolution [OPTIONAL]",
        "chart_21_product_roadmap_timeline.png - Product Roadmap Timeline [OPTIONAL]",
        "chart_22_geographic_expansion_map.png - Geographic Expansion Map [OPTIONAL]",
        "chart_23_rd_investment_trends.png - R&D Investment Trends [OPTIONAL]",
        "chart_24_sales_marketing_efficiency.png - Sales & Marketing Efficiency [OPTIONAL]",
        "chart_25_working_capital_trends.png - Working Capital Trends [OPTIONAL]",
        "chart_26_debt_maturity_schedule.png - Debt Maturity Schedule [OPTIONAL]",
        "chart_27_ownership_structure.png - Ownership Structure [OPTIONAL]",
        "chart_35_analyst_price_targets.png - Analyst Price Target Distribution [OPTIONAL]",
    ]

    with open('chart_index.txt', 'w') as f:
        f.write("CHART INDEX FOR [COMPANY] EQUITY RESEARCH REPORT\n")
        f.write("=" * 60 + "\n\n")

        f.write("4 MANDATORY CHARTS (Must be present):\n")
        f.write("- chart_03: Revenue by Product (Stacked Area) ⭐\n")
        f.write("- chart_04: Revenue by Geography (Stacked Bar) ⭐\n")
        f.write("- chart_28: DCF Sensitivity (Heatmap) ⭐\n")
        f.write("- chart_32: Valuation Football Field ⭐\n\n")

        f.write("25 REQUIRED CHARTS:\n")
        for chart in required_charts:
            f.write(f"  {chart}\n")

        f.write("\n10 OPTIONAL CHARTS (for 26-35 total):\n")
        for chart in optional_charts:
            f.write(f"  {chart}\n")

        f.write("\n" + "=" * 60 + "\n")
        f.write("NOTE: Task 5 will embed ALL charts created (25-35) throughout\n")
        f.write("the report for visual density (1 chart every 200-300 words).\n")

    print("✓ Created: chart_index.txt")

create_chart_index()
Raw lines 582 to 659
660### Step 6: Quality Check
662**Run verification checks:**
664```python
665import os
667def verify_charts():
668 """Verify all charts were created successfully"""
670 mandatory_charts = [
671 'chart_03_revenue_by_product_stacked_area.png',
672 'chart_04_revenue_by_geography_stacked_bar.png',
673 'chart_28_dcf_sensitivity_heatmap.png',
674 'chart_32_valuation_football_field.png'
675 ]
677 print("\n" + "="*60)
678 print("CHART GENERATION VERIFICATION")
679 print("="*60)
681 # Check mandatory charts
682 print("\n1. MANDATORY CHARTS:")
683 all_mandatory_present = True
684 for chart in mandatory_charts:
685 if os.path.exists(chart):
686 size = os.path.getsize(chart) / 1024 # KB
687 print(f" ✓ {chart} ({size:.1f} KB)")
688 else:
689 print(f" ✗ MISSING: {chart}")
690 all_mandatory_present = False
692 # Count total charts
693 chart_files = [f for f in os.listdir('.') if f.startswith('chart_') and f.endswith('.png')]
694 print(f"\n2. TOTAL CHARTS: {len(chart_files)}")
695 print(f" Target: 25-35 charts")
696 print(f" Status: {'✓ PASS' if 25 <= len(chart_files) <= 35 else '⚠ WARNING'}")
698 # Check file sizes (should be > 50KB for 300 DPI)
699 print("\n3. FILE SIZE CHECK:")
700 small_files = []
701 for chart in chart_files[:5]: # Sample first 5
702 size = os.path.getsize(chart) / 1024
703 if size < 50:
704 small_files.append(chart)
705 print(f" {chart}: {size:.1f} KB")
707 if small_files:
708 print(f" ⚠ WARNING: {len(small_files)} files may be low resolution")
709 else:
710 print(f" ✓ All sampled files have adequate size")
712 # Final verdict
713 print("\n" + "="*60)
714 if all_mandatory_present and 25 <= len(chart_files) <= 35:
715 print("✓ VERIFICATION PASSED - Ready for Task 5")
716 else:
717 print("✗ VERIFICATION FAILED - Review missing charts")
718 print("="*60 + "\n")
720verify_charts()
721```
723---

Step 6: Quality Check

Run verification checks:

import os

def verify_charts():
    """Verify all charts were created successfully"""

    mandatory_charts = [
        'chart_03_revenue_by_product_stacked_area.png',
        'chart_04_revenue_by_geography_stacked_bar.png',
        'chart_28_dcf_sensitivity_heatmap.png',
        'chart_32_valuation_football_field.png'
    ]

    print("\n" + "="*60)
    print("CHART GENERATION VERIFICATION")
    print("="*60)

    # Check mandatory charts
    print("\n1. MANDATORY CHARTS:")
    all_mandatory_present = True
    for chart in mandatory_charts:
        if os.path.exists(chart):
            size = os.path.getsize(chart) / 1024  # KB
            print(f"   ✓ {chart} ({size:.1f} KB)")
        else:
            print(f"   ✗ MISSING: {chart}")
            all_mandatory_present = False

    # Count total charts
    chart_files = [f for f in os.listdir('.') if f.startswith('chart_') and f.endswith('.png')]
    print(f"\n2. TOTAL CHARTS: {len(chart_files)}")
    print(f"   Target: 25-35 charts")
    print(f"   Status: {'✓ PASS' if 25 <= len(chart_files) <= 35 else '⚠ WARNING'}")

    # Check file sizes (should be > 50KB for 300 DPI)
    print("\n3. FILE SIZE CHECK:")
    small_files = []
    for chart in chart_files[:5]:  # Sample first 5
        size = os.path.getsize(chart) / 1024
        if size < 50:
            small_files.append(chart)
        print(f"   {chart}: {size:.1f} KB")

    if small_files:
        print(f"   ⚠ WARNING: {len(small_files)} files may be low resolution")
    else:
        print(f"   ✓ All sampled files have adequate size")

    # Final verdict
    print("\n" + "="*60)
    if all_mandatory_present and 25 <= len(chart_files) <= 35:
        print("✓ VERIFICATION PASSED - Ready for Task 5")
    else:
        print("✗ VERIFICATION FAILED - Review missing charts")
    print("="*60 + "\n")

verify_charts()

Raw lines 660 to 724
725## Quality Standards

Quality Standards

Raw lines 725 to 726
727### Visual Quality
728- [ ] High resolution (300 DPI minimum)
729- [ ] Professional color scheme (consistent across all charts)
730- [ ] Clear, legible text (no fonts smaller than 9pt)
731- [ ] Proper aspect ratio (no distortion)
732- [ ] No pixelation or artifacts

Visual Quality

  • [ ] High resolution (300 DPI minimum)
  • [ ] Professional color scheme (consistent across all charts)
  • [ ] Clear, legible text (no fonts smaller than 9pt)
  • [ ] Proper aspect ratio (no distortion)
  • [ ] No pixelation or artifacts
Raw lines 727 to 733
734### Data Accuracy
735- [ ] Data matches source (financial model and valuation)
736- [ ] Proper units and labels ($ millions, percentages, etc.)
737- [ ] Appropriate scale and range
738- [ ] Consistent time periods across charts
739- [ ] Verified calculations

Data Accuracy

  • [ ] Data matches source (financial model and valuation)
  • [ ] Proper units and labels ($ millions, percentages, etc.)
  • [ ] Appropriate scale and range
  • [ ] Consistent time periods across charts
  • [ ] Verified calculations
Raw lines 734 to 740
741### Formatting Quality
742- [ ] Consistent styling across all charts
743- [ ] Proper figure numbering (sequential)
744- [ ] Clear titles and captions
745- [ ] Source citations on every chart
746- [ ] Professional appearance

Formatting Quality

  • [ ] Consistent styling across all charts
  • [ ] Proper figure numbering (sequential)
  • [ ] Clear titles and captions
  • [ ] Source citations on every chart
  • [ ] Professional appearance
Raw lines 741 to 747
748### Completeness
749- [ ] All 4 mandatory charts created
750- [ ] 25-35 total charts
751- [ ] Proper file naming (chart_01, chart_02, etc.)
752- [ ] Chart index created
753- [ ] Ready for embedding in Word
755---

Completeness

  • [ ] All 4 mandatory charts created
  • [ ] 25-35 total charts
  • [ ] Proper file naming (chart_01, chart_02, etc.)
  • [ ] Chart index created
  • [ ] Ready for embedding in Word

Raw lines 748 to 756
757## Chart Types Reference

Chart Types Reference

Raw lines 757 to 758
759### When to Use Each Chart Type
761**Line Charts**: Time series trends (revenue, margins, stock price)
763**Stacked Area**: Revenue by product ⭐, market size composition
765**Stacked Bar**: Revenue by geography ⭐, quarterly breakdowns
767**Heatmap**: DCF sensitivity ⭐, correlation matrices
769**Horizontal Bar**: Valuation football field ⭐, peer rankings
771**Waterfall**: Revenue bridges, margin analysis, DCF build-up
773**Scatter/Bubble**: Growth vs. valuation, competitive positioning
775**2×2 Matrix**: Competitive positioning, product portfolio
777---

When to Use Each Chart Type

Line Charts: Time series trends (revenue, margins, stock price)

Stacked Area: Revenue by product ⭐, market size composition

Stacked Bar: Revenue by geography ⭐, quarterly breakdowns

Heatmap: DCF sensitivity ⭐, correlation matrices

Horizontal Bar: Valuation football field ⭐, peer rankings

Waterfall: Revenue bridges, margin analysis, DCF build-up

Scatter/Bubble: Growth vs. valuation, competitive positioning

2×2 Matrix: Competitive positioning, product portfolio


Raw lines 759 to 778
779## File Naming Convention
781**Always use this format:**
782```
783chart_[NUMBER]_[DESCRIPTION].png
785Examples:
786chart_01_stock_price_performance.png
787chart_03_revenue_by_product_stacked_area.png
788chart_28_dcf_sensitivity_heatmap.png
789```
791**Number charts sequentially** based on their position in the report, not creation order.
793---

File Naming Convention

Always use this format:

chart_[NUMBER]_[DESCRIPTION].png

Examples:
chart_01_stock_price_performance.png
chart_03_revenue_by_product_stacked_area.png
chart_28_dcf_sensitivity_heatmap.png

Number charts sequentially based on their position in the report, not creation order.


Raw lines 779 to 794
795## Common Chart Generation Issues

Common Chart Generation Issues

Raw lines 795 to 796
797### Issue 1: Low Resolution
798**Problem**: Chart looks pixelated
799**Solution**: Ensure `dpi=300` in `plt.savefig()`

Issue 1: Low Resolution

Problem: Chart looks pixelated Solution: Ensure dpi=300 in plt.savefig()

Raw lines 797 to 800
801### Issue 2: Text Cutoff
802**Problem**: Labels or titles cut off at edges
803**Solution**: Use `bbox_inches='tight'` in `plt.savefig()`

Issue 2: Text Cutoff

Problem: Labels or titles cut off at edges Solution: Use bbox_inches='tight' in plt.savefig()

Raw lines 801 to 804
805### Issue 3: Poor Colors
806**Problem**: Colors don't look professional
807**Solution**: Use established palettes like Tableau10 or define custom corporate colors

Issue 3: Poor Colors

Problem: Colors don't look professional Solution: Use established palettes like Tableau10 or define custom corporate colors

Raw lines 805 to 808
809### Issue 4: Overlapping Labels
810**Problem**: Axis labels overlap
811**Solution**: Rotate labels (e.g., `rotation=45`) or reduce font size

Issue 4: Overlapping Labels

Problem: Axis labels overlap Solution: Rotate labels (e.g., rotation=45) or reduce font size

Raw lines 809 to 812
813### Issue 5: White Space
814**Problem**: Too much white space around chart
815**Solution**: Use `plt.tight_layout()` before saving
817---

Issue 5: White Space

Problem: Too much white space around chart Solution: Use plt.tight_layout() before saving


Raw lines 813 to 818
819## Success Criteria
821A successful chart package should:
8221. **Include all 4 mandatory charts** (verified) ⭐
823 - chart_03: Revenue by Product
824 - chart_04: Revenue by Geography
825 - chart_28: DCF Sensitivity
826 - chart_32: Valuation Football Field
8272. **Create 25 required charts minimum** (verified)
8283. **Optional: 1-10 additional charts** for 26-35 total
8294. Have consistent professional styling across all charts
8305. Be high resolution (300 DPI) for print quality
8316. Have clear labels, legends, and titles on every chart
8327. Include proper figure numbers and source citations
8338. Be ready for immediate embedding in Word
8349. Cover all key financial metrics and analyses
83510. Tell a visual story complementing the written analysis
83611. Be accurate and auditable to source data (model/valuation)
83712. All charts packaged in zip file with chart index
839**Remember**: Task 5 will embed ALL charts created (25-35) throughout the report for visual density.
841---

Success Criteria

A successful chart package should:

  1. Include all 4 mandatory charts (verified) ⭐
  2. chart_03: Revenue by Product
  3. chart_04: Revenue by Geography
  4. chart_28: DCF Sensitivity
  5. chart_32: Valuation Football Field
  6. Create 25 required charts minimum (verified)
  7. Optional: 1-10 additional charts for 26-35 total
  8. Have consistent professional styling across all charts
  9. Be high resolution (300 DPI) for print quality
  10. Have clear labels, legends, and titles on every chart
  11. Include proper figure numbers and source citations
  12. Be ready for immediate embedding in Word
  13. Cover all key financial metrics and analyses
  14. Tell a visual story complementing the written analysis
  15. Be accurate and auditable to source data (model/valuation)
  16. All charts packaged in zip file with chart index

Remember: Task 5 will embed ALL charts created (25-35) throughout the report for visual density.


Raw lines 819 to 842
843## Output Files
845After completing Task 4, deliverables include:
847**25 REQUIRED Chart Files (Minimum):**
8481. chart_01_stock_price_performance.png
8492. chart_02_revenue_growth_trajectory.png
8503. chart_03_revenue_by_product_stacked_area.png ⭐ MANDATORY
8514. chart_04_revenue_by_geography_stacked_bar.png ⭐ MANDATORY
8525. chart_05_company_overview.png
8536. chart_06_key_milestones_timeline.png
8547. chart_07_organizational_structure.png
8558. chart_08_product_portfolio.png
8569. chart_09_customer_segmentation.png
85710. chart_10_gross_margin_evolution.png
85811. chart_11_ebitda_margin_progression.png
85912. chart_12_free_cash_flow_trend.png
86013. chart_13_operating_metrics_dashboard.png
86114. chart_14_scenario_comparison.png
86215. chart_15_market_size_evolution.png
86316. chart_16_competitive_positioning.png
86417. chart_17_market_share.png
86518. chart_18_competitive_benchmarking.png
86619-27. *Reserved for optional charts if created*
86728. chart_28_dcf_sensitivity_heatmap.png ⭐ MANDATORY
86829. chart_29_dcf_waterfall.png
86930. chart_30_trading_comps_scatter.png
87031. chart_31_peer_multiples_comparison.png
87132. chart_32_valuation_football_field.png ⭐ MANDATORY
87233. chart_33_price_target_scenarios.png
87334. chart_34_historical_valuation_multiples.png
87435. *Reserved for optional chart if created*
876**10 OPTIONAL Chart Files (For 26-35 Total):**
877- chart_19 through chart_27, chart_35 (if created)
879**Chart Index** (1 text file):
880- chart_index.txt (listing all charts with descriptions and categories)
882**All chart files must be:**
883- 300 DPI resolution (print quality)
884- 6-10 inches wide (standard Word embedding size)
885- White background (professional appearance)
886- PNG format (lossless quality)
887- Ready for immediate Word embedding
889**Final Step: Package All Charts**
891Create a zip file containing all chart files and the chart index:
893```
894[Company]_Charts_[Date].zip
895├── chart_01_stock_price_performance.png
896├── chart_02_revenue_growth_trajectory.png
897├── chart_03_revenue_by_product_stacked_area.png ⭐
898├── chart_04_revenue_by_geography_stacked_bar.png ⭐
899├── chart_05_company_overview.png
900├── ... (all 25-35 chart files)
901├── chart_28_dcf_sensitivity_heatmap.png ⭐
902├── chart_32_valuation_football_field.png ⭐
903├── chart_34_historical_valuation_multiples.png
904└── chart_index.txt
905```
907**Example**: `Tesla_Charts_2024-10-28.zip`
909**Why this matters**: Task 5 will embed ALL charts created (25-35) throughout the report. The report requires visual density (1 chart per 200-300 words), so all charts serve a purpose—either for specific analytical sections or for visual storytelling and page density.
910- Verify all 25-35 charts are present
911- Extract charts for Task 5 (Report Assembly)
913---

Output Files

After completing Task 4, deliverables include:

25 REQUIRED Chart Files (Minimum):

  1. chart_01_stock_price_performance.png
  2. chart_02_revenue_growth_trajectory.png
  3. chart_03_revenue_by_product_stacked_area.png ⭐ MANDATORY
  4. chart_04_revenue_by_geography_stacked_bar.png ⭐ MANDATORY
  5. chart_05_company_overview.png
  6. chart_06_key_milestones_timeline.png
  7. chart_07_organizational_structure.png
  8. chart_08_product_portfolio.png
  9. chart_09_customer_segmentation.png
  10. chart_10_gross_margin_evolution.png
  11. chart_11_ebitda_margin_progression.png
  12. chart_12_free_cash_flow_trend.png
  13. chart_13_operating_metrics_dashboard.png
  14. chart_14_scenario_comparison.png
  15. chart_15_market_size_evolution.png
  16. chart_16_competitive_positioning.png
  17. chart_17_market_share.png
  18. chart_18_competitive_benchmarking.png

19-27. Reserved for optional charts if created

  1. chart_28_dcf_sensitivity_heatmap.png ⭐ MANDATORY
  2. chart_29_dcf_waterfall.png
  3. chart_30_trading_comps_scatter.png
  4. chart_31_peer_multiples_comparison.png
  5. chart_32_valuation_football_field.png ⭐ MANDATORY
  6. chart_33_price_target_scenarios.png
  7. chart_34_historical_valuation_multiples.png
  8. Reserved for optional chart if created

10 OPTIONAL Chart Files (For 26-35 Total):

  • chart_19 through chart_27, chart_35 (if created)

Chart Index (1 text file):

  • chart_index.txt (listing all charts with descriptions and categories)

All chart files must be:

  • 300 DPI resolution (print quality)
  • 6-10 inches wide (standard Word embedding size)
  • White background (professional appearance)
  • PNG format (lossless quality)
  • Ready for immediate Word embedding

Final Step: Package All Charts

Create a zip file containing all chart files and the chart index:

[Company]_Charts_[Date].zip
├── chart_01_stock_price_performance.png
├── chart_02_revenue_growth_trajectory.png
├── chart_03_revenue_by_product_stacked_area.png ⭐
├── chart_04_revenue_by_geography_stacked_bar.png ⭐
├── chart_05_company_overview.png
├── ... (all 25-35 chart files)
├── chart_28_dcf_sensitivity_heatmap.png ⭐
├── chart_32_valuation_football_field.png ⭐
├── chart_34_historical_valuation_multiples.png
└── chart_index.txt

Example: Tesla_Charts_2024-10-28.zip

Why this matters: Task 5 will embed ALL charts created (25-35) throughout the report. The report requires visual density (1 chart per 200-300 words), so all charts serve a purpose—either for specific analytical sections or for visual storytelling and page density.

  • Verify all 25-35 charts are present
  • Extract charts for Task 5 (Report Assembly)

Raw lines 843 to 914
915## Next Steps
917After completing Task 4, the zip file will be used for:
918- **Task 5 (Report Assembly)**: Extract charts and embed all into the final DOCX report at appropriate locations throughout the document
920The 4 mandatory charts are critical for the valuation and financial analysis sections of the report.

Next Steps

After completing Task 4, the zip file will be used for:

  • Task 5 (Report Assembly): Extract charts and embed all into the final DOCX report at appropriate locations throughout the document

The 4 mandatory charts are critical for the valuation and financial analysis sections of the report.

Raw lines 915 to 920