Skip to content

fix: Set better Chart Axis Bounds - #1585

Merged
kodiakhq[bot] merged 1 commit into
mainfrom
drew/axis-bounds
Jan 9, 2026
Merged

kodiakhq[bot] merged 1 commit into
mainfrom
drew/axis-bounds

Conversation

@pulpdrew

@pulpdrew pulpdrew commented Jan 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes HDX-3180

Summary

This PR makes a couple of changes to TimeChart axis bounds

  1. Y Axis lower bound is now always 0 unless a series is selected (partial revert of feat: Add chart legend series filtering #1572)
  2. X-Axis bounds have been adjusted so that
    1. There is no longer an empty partial interval's worth of space at the end of line charts
    2. The first bar of a bar chart no longer overlaps with the Y Axis

Before

  • The first Bar in bar charts overlaps the Y Axis
Screenshot 2026-01-09 at 2 55 27 PM
  • There is an empty partial (or full) interval at the end of charts
Screenshot 2026-01-09 at 2 55 21 PM
  • Y Axis lower bound is non-zero when no series are selected
Screenshot 2026-01-09 at 2 38 54 PM Screenshot 2026-01-09 at 2 37 26 PM

After

  • Bars fit fully within the chart domain
Screenshot 2026-01-09 at 2 55 42 PM
  • There is no empty space at the end of the line charts
  • Y Axis lower bound is always 0 when no series are selected
Screenshot 2026-01-09 at 2 55 50 PM

@changeset-bot

changeset-bot Bot commented Jan 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 35cb617

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jan 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview, Comment Jan 9, 2026 8:28pm

@claude

claude Bot commented Jan 9, 2026 •

Copy link
Copy Markdown

Code Review

✅ No critical issues found.

The changes properly fix chart axis bounds with clean implementation:

Strengths:

  • Y-axis now defaults to 0 (better UX for most time-series charts)
  • X-axis domain calculation correctly handles bar chart padding
  • Proper use of isSameSecond and date-fns utilities
  • New required props passed from sole caller (DBTimeChart.tsx)
  • Changeset file included

Minor observations:

  • dateRangeEndInclusive defaults to true in MemoChart signature but is set to false in convertToTimeChartConfig - ensure this is intentional behavior
  • Consider adding JSDoc comment to explain the half-granularity padding logic for bar charts (lines 597-603)

Changes are well-contained and safe to merge.

@github-actions

github-actions Bot commented Jan 9, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 59 passed • 4 skipped • 864s

Status Count
✅ Passed 59
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 4

Tests ran across 4 shards in parallel.

View full report →

@pulpdrew
pulpdrew requested review from a team and knudtty and removed request for a team January 9, 2026 20:44

@brandon-pereira brandon-pereira left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, ty!

@kodiakhq
kodiakhq Bot merged commit 1e6987e into main Jan 9, 2026
14 checks passed
@kodiakhq
kodiakhq Bot deleted the drew/axis-bounds branch January 9, 2026 20:49
knudtty pushed a commit that referenced this pull request Apr 16, 2026
Closes HDX-3180

# Summary

This PR makes a couple of changes to TimeChart axis bounds

1. Y Axis lower bound is now always 0 unless a series is selected (partial revert of #1572)
2. X-Axis bounds have been adjusted so that
   1. There is no longer an empty partial interval's worth of space at the end of line charts
   2. The first bar of a bar chart no longer overlaps with the Y Axis


## Before

- The first Bar in bar charts overlaps the Y Axis

<img width="1600" height="495" alt="Screenshot 2026-01-09 at 2 55 27 PM" src="https://github.com/user-attachments/assets/13087084-4847-46d5-98d3-85340101d7f3" />

- There is an empty partial (or full) interval at the end of charts

<img width="1611" height="483" alt="Screenshot 2026-01-09 at 2 55 21 PM" src="https://github.com/user-attachments/assets/a286966b-ccfa-485c-8d26-7090f75120e0" />

- Y Axis lower bound is non-zero when no series are selected

<img width="1603" height="388" alt="Screenshot 2026-01-09 at 2 38 54 PM" src="https://github.com/user-attachments/assets/4ca2743a-d484-40b1-b2e6-352aad838070" />
<img width="1623" height="373" alt="Screenshot 2026-01-09 at 2 37 26 PM" src="https://github.com/user-attachments/assets/4a8b9490-9efb-4c75-93b4-edb3321ee0a2" />

## After

- Bars fit fully within the chart domain

<img width="1610" height="503" alt="Screenshot 2026-01-09 at 2 55 42 PM" src="https://github.com/user-attachments/assets/42ab1f62-4c1e-475f-b3be-4bf6ed147dc4" />

- There is no empty space at the end of the line charts
- Y Axis lower bound is always 0 when no series are selected

<img width="1613" height="490" alt="Screenshot 2026-01-09 at 2 55 50 PM" src="https://github.com/user-attachments/assets/ed723a99-2a24-47f2-8ac8-93901f7fbf88" />

This branch was successfully deployed

1 active deployment
Preview — 35cb617c Deployed Jan 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants