# ISS-0110: Studio Key Evidence 面板 Prometheus 图表 X 轴跨度过大导致图形无法阅读

## Background

GitHub issue #680, workspace ws-1781673884286-667cf2c1d (prod, TCOC-5426).

User requested a comparison between two time ranges 20 days apart. The Studio "Key Evidence"
section displayed two Prometheus graphs ("TIKV CPU" and "Disk IO Utilization") that placed
**both** time ranges on the **same graph**, resulting in an x-axis spanning 20+ days where the
majority of the chart area is empty space. The graphs were completely unreadable.

## Observed Error

User report (GitHub issue #680):
> "There are 2 referenced Prometheus graphs ('TIKV CPU' and 'Disk IO Utilization'). In the
> request I asked for comparison between two time ranges which are 20 days apart. The evidence
> placed **both** ranges within the **same** graph. The result is an x-axis range so wide which
> the majority is just empty space, and the graph is totally unreadable."

## Root Cause Analysis

The Studio panel's Prometheus graph embedding renders a single time-series chart with the full
span from the earliest to the latest timestamp across all referenced evidence ranges. When the
user asks for a comparison across two time windows far apart in time, the chart renderer merges
them into one contiguous x-axis — making neither range readable.

Two separate issues:
1. **Graph time window selection**: When evidence references multiple disjoint time windows, the
   graph should render them as **separate panels** (one per time range) rather than one merged
   timeline.
2. **Unreadable empty space**: Even if a single merged timeline is intentional, the render should
   zoom to show only the non-empty portions, not the blank 20-day gap between two small windows.

Relevant code: `frontend/components/StudioPanel/` (graph/evidence rendering logic).

## Fix Plan

### Short-term (recommended)
1. In the Studio evidence graph renderer, detect when evidence references two or more disjoint
   time windows (gap > threshold, e.g., 2 hours).
2. When disjoint windows are detected, render **one panel per time window** side-by-side or
   stacked, rather than a single merged timeline.
3. Label each panel with its time range for clarity (e.g., "Range A: 2026-05-10 10:00–11:00",
   "Range B: 2026-05-30 10:00–11:00").

### Alternative (fallback)
If splitting into multiple panels is not feasible short-term, add a "zoom to data" post-processing
step that crops the x-axis to only the ranges with actual data, eliminating the empty gap. This
still loses visual time-scale accuracy but is far more readable than the current behavior.

### Files to modify
- `frontend/components/StudioPanel/` — graph rendering and evidence reference parsing
- Check how time ranges are passed to the Prometheus/Grafana embed URL parameters

## Verification

1. Create a workspace with two Prometheus evidence items referencing time ranges 20+ days apart.
2. Open Studio → Key Evidence → confirm two separate panels render, each showing their respective
   time window with data visible and no large empty gaps.
