{# Inputs: monthly_pl_points: list[MonthlyPnlPoint] -- chronological, may be empty period_label: str -- e.g. "YTD 2026", "2025", "Lifetime" #} {% set has_data = monthly_pl_points and (monthly_pl_points|map(attribute='trade_count')|sum) > 0 %}

Monthly realized P&L

{{ period_label }}
{% if not has_data %}
No realized closes in {{ period_label }}.
{% else %} {# Always wrap in an overflow-x container so the same CSS path covers both YTD/single-year (which fit) and Lifetime (which can scroll). The inner min-width keeps each bar at least 32px wide once the count exceeds the panel's natural width. #}
{% endif %}