Charts¶
Chart.js chart data for client-side rendering.
generate_projection_fan_chart¶
Generate projection fan chart data for client-side rendering.
| Parameter | Type | Default | Description |
|---|---|---|---|
initial_balance_cents |
int | required | Starting balance in cents |
expected_annual_return |
float | required | Expected annual return (e.g., 0.07 = 7%) |
time_horizon_months |
int | required | Number of months to project |
annual_volatility |
float | 0.15 |
Annual volatility/std dev (e.g., 0.15 = 15%) |
monthly_contribution_cents |
int | 0 |
Fixed monthly contribution in cents |
title |
string | "Portfolio Projection" |
Chart title |
show_deposits_line |
bool | true |
Show cumulative net deposits line on the chart |
inflation |
float | 0.0 |
Annual inflation rate as decimal (e.g., 0.03 = 3%). When > 0, chart values are in today's purchasing power (real dollars). |
Returns file URLs + compact inline summary. Full chart data is written
generate_account_breakdown_chart¶
Generate account breakdown chart data for client-side rendering.
| Parameter | Type | Default | Description |
|---|---|---|---|
initial_balances |
dict[str, int] | required | Dict mapping account names to initial balances in cents (e.g., {'401k': 10000000, 'Roth IRA': 5000000}) |
expected_annual_return |
float | required | Expected annual return (e.g., 0.07 = 7%) |
time_horizon_months |
int | required | Number of months to project |
title |
string | "Portfolio Breakdown by Account" |
Chart title |
show_total_line |
bool | true |
Show total portfolio value line on top |
Returns file URLs + compact inline summary. Full chart data is written
generate_allocation_chart¶
Generate allocation glide path chart data for client-side rendering.
| Parameter | Type | Default | Description |
|---|---|---|---|
allocations |
list | required | List of allocation dicts with 'stocks_pct', 'bonds_pct', 'cash_pct' keys (must sum to 100) |
months |
list | required | List of month numbers corresponding to each allocation (e.g., [0, 120, 240, 360]) |
title |
string | "Asset Allocation Over Time" |
Chart title |
Returns file URLs + compact inline summary. Full chart data is written
generate_scenario_comparison_chart¶
Generate scenario comparison chart data for client-side rendering.
| Parameter | Type | Default | Description |
|---|---|---|---|
scenarios |
list | required | List of scenario dicts, each with: 'name' (str), 'initial_balance_cents' (int), 'expected_annual_return' (float), 'annual_volatility' (float), 'monthly_contribution_cents' (int, optional) |
time_horizon_months |
int | required | Number of months to project |
percentile |
int | 50 |
Percentile to compare (default: 50 for median) |
title |
string | "Scenario Comparison" |
Chart title |
inflation |
float | 0.0 |
Annual inflation rate as decimal (e.g., 0.03 = 3%). When > 0, chart values are in today's purchasing power (real dollars). |
Returns file URLs + compact inline summary. Full chart data is written