Skip to content

Comparison overlay: same metric over the previous window #1460

Description

@kylebernhardy

The standard "is this normal?" affordance: a toggle that overlays a ghost/dashed line of the same metric from the previous window (yesterday / last week, matched to the preset) time-shifted onto the current chart. Requires one extra query per panel with the shifted range (the query layer already parameterizes start/end) and a muted series style.

Acceptance criteria

  • Toolbar toggle "Compare: previous period" (URL-encoded, e.g. compare=1, in statusSearch.ts; default off).
  • When on, each line chart overlays the same metric from the immediately preceding window of equal length, time-shifted to align, rendered dashed/muted and legend-labelled "(prev)"; tooltips label both series sets.
  • No extra fetches while the toggle is off; presets only (disabled for a custom historical range if Custom time range and brush/zoom for Status charts #1456 lands first).

Implementation notes

  • One extra useAnalyticsRecords call per panel with the shifted window, gated on the toggle; shift each point's x by the window duration before rendering; muted style via opacity/strokeDasharray on the existing Series fields.

Filed from a Status tab code review.

Comment generated by kAIle (Claude Fable 5)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions