Skip to content

[FIX] chart: prevent line chart value labels from clipping#8030

Open
rmbh-odoo wants to merge 1 commit into18.0from
18.0-fix-line-chart-show-value-cut-on-edges-rmbh
Open

[FIX] chart: prevent line chart value labels from clipping#8030
rmbh-odoo wants to merge 1 commit into18.0from
18.0-fix-line-chart-show-value-cut-on-edges-rmbh

Conversation

@rmbh-odoo
Copy link
Contributor

Description:

Current behavior before PR:

  • Line chart value labels were clipped at chart edges.
  • First and last points could cut horizontally at left/right.
  • Top-most points could cut vertically at the top boundary.
  • Positioning relied on clamp, causing labels to stick to borders.

Desired behavior after PR is merged:

  • Implement smart boundary-aware positioning for line labels.
  • Flip label below point if it cannot fit above.
  • Add horizontal edge detection and adjust textAlign dynamically.
  • Preserve existing bar chart behavior and layout settings.

Task: 5993132

review checklist

  • feature is organized in plugin, or UI components
  • support of duplicate sheet (deep copy)
  • in model/core: ranges are Range object, and can be adapted (adaptRanges)
  • in model/UI: ranges are strings (to show the user)
  • undo-able commands (uses this.history.update)
  • multiuser-able commands (has inverse commands and transformations where needed)
  • new/updated/removed commands are documented
  • exportable in excel
  • translations (_t("qmsdf %s", abc))
  • unit tested
  • clean commented code
  • track breaking changes
  • doc is rebuild (npm run doc)
  • status is correct in Odoo

@robodoo
Copy link
Collaborator

robodoo commented Mar 3, 2026

Pull request status dashboard

Before this commit:
- Line chart value labels were clipped at chart edges.
- First and last points could cut horizontally at left/right.
- Top-most points could cut vertically at the top boundary.
- Positioning relied on clamp, causing labels to stick to borders.

After this commit:
- Implement smart boundary-aware positioning for line labels.
- Flip label below point if it cannot fit above.
- Add horizontal edge detection and adjust textAlign dynamically.
- Preserve existing bar chart behavior and layout settings.

Task: 5993132
@rmbh-odoo rmbh-odoo force-pushed the 18.0-fix-line-chart-show-value-cut-on-edges-rmbh branch from e59d4b1 to 2c868bd Compare March 3, 2026 09:17
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.

3 participants