{# Cost-trend line chart. Reused by: - templates/jobs/cohort.html — full cohort view at /jobs/{table} - templates/opportunities/detail.html — embedded for context Caller sets: - chart_points_payload : list[dict] (from cohort_view.build_chart_points_payload or JobCohortView.chart_points_payload()). REQUIRED. - chart_title : str (defaults to "Cost trend") - chart_subtitle : str (default explains skipped-days) X axis: dense sequence of UTC days where ≥ 1 execution ran (per spec 146 decision — skip days with no executions, do not pretend the X axis is a continuous calendar). Y axis: USD cost summed over executions on that day. Markers: a contrasting scatter point overlays days where the execution at that day's first run is the FIRST occurrence of its query_hash (i.e., a version transition started here). Click handler: navigates to /jobs/{first_job_id_for_that_day}?from=cohort. Mirrors the dashboard's _trend_chart.html ECharts/ChartUtils setup so the colours / axis styling stay consistent with the rest of the audit. #} {% set _chart_title = chart_title | default("Cost trend") %} {% set _chart_subtitle = chart_subtitle | default("One point per day. Days without executions are skipped.") %} {# ``chart_collapsible`` (default false): when true the partial wraps the chart in a ``
`` so the user has to click to expand. Used by the opportunity detail page where the chart is contextual, not the page's main feature. The cohort view passes false (default) so the chart stays visible. The collapsible variant dispatches a window resize event on toggle so the existing ``ChartUtils.setupChartResize`` listener re-measures the container and renders the line that was queued while the section was closed. #} {% set _collapsible = chart_collapsible | default(false) %} {% if _collapsible %}
{{ _chart_title }} {{ _chart_subtitle }}
{% if chart_points_payload %}
{% else %}

No executions in the current scan window.

{% endif %}
{% else %}

{{ _chart_title }}

{{ _chart_subtitle }}

{% if chart_points_payload %}
{% else %}

No executions in the current scan window.

{% endif %}
{% endif %} {% if chart_points_payload %} {% endif %}