← 输入框|github.com|刷新
Skip to content

web: sort metrics chart tooltip and legend by value - #19

Merged
yekta merged 1 commit into
masterfrom
feat/sort-metrics-tooltip-legend
Oct 17, 2026
Merged

yekta merged 1 commit into
masterfrom
feat/sort-metrics-tooltip-legend

Conversation

@yekta

@yekta yekta commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Resolves UNB-458.

The metrics chart tooltip and legend listed series in the order the API returned them. With many services it was hard to see which ones used the most.

  • Tooltip: rows are sorted largest first by their value at the hovered timestamp. ChartTooltipContent ignored Recharts' itemSorter prop, so it now sorts the payload with itemSorter itself. MetricsChart passes a descending-by-value sorter.
  • Legend: entries are sorted largest first by their average over the chart's time window. Null and missing points are left out of the average.

The legend still uses the series config, so colours and the click-to-isolate filter stay the same.

With many services the tooltip listed series in API order, so the largest consumers were hard to spot.

- Tooltip rows are now sorted by their value at the hovered timestamp, largest first. ChartTooltipContent ignored Recharts' itemSorter, so it now applies the sorter to the payload itself.
- Legend entries are sorted by their average value over the window, largest first.
@yekta
yekta merged commit b581263 into master Oct 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant