Skip to content

feat: kpi chart improvements#8645

Merged
briangregoryholmes merged 3 commits intomainfrom
bgh/chart-improvements
Jan 15, 2026
Merged

feat: kpi chart improvements#8645
briangregoryholmes merged 3 commits intomainfrom
bgh/chart-improvements

Conversation

@briangregoryholmes
Copy link
Contributor

@briangregoryholmes briangregoryholmes commented Jan 14, 2026

This PR addresses a few limitations of the KPI/Chart sparkline component regarding tooltips and comparison data:

  1. Lines with different numbers of points became out of sync (e.g., 31 days vs 30 days)
  2. Tooltip trigger area was inconsistent and hard to activate
  3. Tooltip showed empty when hovering over null data points
  4. Comparison mode didn't show timestamps or "vs." dates

Comparison data sync

  • Replaced date-based x-axis positioning with index-based positioning
  • Both lines now align by index (day 1 vs day 1) regardless of actual dates
  • Uses the longer of the two datasets for the x-scale, so no data is truncated

Tooltip improvements

  • Tooltip now triggers reliably based on x-position (removed restrictive y-proximity check)
  • Fixed empty tooltip container showing when all points at an index are null
  • Added formatted timestamps to tooltip when comparison mode is active
  • Tooltip is tracked to the cursor position

Range display

  • Shows "vs." comparison date when hovering (e.g., "May 30 vs. Apr 30, 2025")
  • Static date labels correctly show primary data's actual date range

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@briangregoryholmes briangregoryholmes merged commit c4b8247 into main Jan 15, 2026
14 of 15 checks passed
@briangregoryholmes briangregoryholmes deleted the bgh/chart-improvements branch January 15, 2026 16:02
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.

2 participants