Skip to content

[DASHBOARDS] Rotate ticks on bar and line charts#16528

Merged
bosiraphael merged 27 commits intomainfrom
1953-rotate-ticks-on-bar-and-line-charts
Dec 16, 2025
Merged

[DASHBOARDS] Rotate ticks on bar and line charts#16528
bosiraphael merged 27 commits intomainfrom
1953-rotate-ticks-on-bar-and-line-charts

Conversation

@bosiraphael
Copy link
Copy Markdown
Contributor

Description

3 steps depending on the widget width. From bigger to tighter space:

  • Fully shown horizontal text
  • Rotated text
  • Rotated text with skipped ticks to avoid overlapping

Also created common files for all constants for bar and pie charts. Since a lot of them are shared, they can be inherited from a common file.

Video QA

CleanShot.2025-12-12.at.15.47.55.mp4

@bosiraphael bosiraphael linked an issue Dec 12, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 95 files

Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.

Prompt for AI agents (all 2 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/twenty-front/src/modules/page-layout/widgets/graph/utils/getTickRotationConfig.ts">

<violation number="1" location="packages/twenty-front/src/modules/page-layout/widgets/graph/utils/getTickRotationConfig.ts:38">
P2: Missing `Math.max(MIN_CALCULATED_LENGTH, ...)` protection in the rotated case. The non-rotated case ensures `calculatedLength` is at least 1, but the rotated case returns the raw calculated value which could be 0 or negative in edge cases.</violation>
</file>

<file name="packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetBarChart/utils/truncateTickLabel.ts">

<violation number="1" location="packages/twenty-front/src/modules/page-layout/widgets/graph/graphWidgetBarChart/utils/truncateTickLabel.ts:9">
P1: Missing guard for small `maxLength` values. When `maxLength &lt; ELLIPSIS_LENGTH`, the slice calculation `maxLength - ELLIPSIS_LENGTH` produces a negative number, causing `slice()` to behave unexpectedly (slicing from the end). This can result in output longer than `maxLength`. Consider restoring a guard like the original `maxLength &lt; 4` check, or `maxLength &lt;= ELLIPSIS_LENGTH`.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@ehconitin ehconitin self-requested a review December 12, 2025 14:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 12, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:13296

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Copy Markdown
Contributor

@ehconitin ehconitin left a comment

Choose a reason for hiding this comment

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

left comments

Copy link
Copy Markdown
Contributor

@ehconitin ehconitin left a comment

Choose a reason for hiding this comment

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

lgtm

@bosiraphael bosiraphael enabled auto-merge (squash) December 16, 2025 16:36
@bosiraphael bosiraphael merged commit 576019e into main Dec 16, 2025
67 checks passed
@bosiraphael bosiraphael deleted the 1953-rotate-ticks-on-bar-and-line-charts branch December 16, 2025 16:39
@twenty-eng-sync
Copy link
Copy Markdown

Hey @bosiraphael! After you've done the QA of your Pull Request, you can mark it as done here. Thank you!

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.

Rotate ticks on bar and line charts

2 participants