Skip to content

fix(charts): fix LineChart left_axis labels display incomplete #6445#6452

Closed
KangZhaoKui wants to merge 1 commit intoflet-dev:mainfrom
KangZhaoKui:main
Closed

fix(charts): fix LineChart left_axis labels display incomplete #6445#6452
KangZhaoKui wants to merge 1 commit intoflet-dev:mainfrom
KangZhaoKui:main

Conversation

@KangZhaoKui
Copy link
Copy Markdown

@KangZhaoKui KangZhaoKui commented Apr 29, 2026

Fixes #6445

Description

The bug was caused by floating-point precision errors in the axis label layout calculation.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Screenshots

issue2

Summary by Sourcery

Bug Fixes:

  • Ensure axis label selection uses a tolerance-based comparison to avoid missing labels due to floating-point precision errors.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 29, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-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.

We've reviewed this pull request using the Sourcery rules engine

@FeodorFitsner
Copy link
Copy Markdown
Contributor

Thank you so much for the report and the fix, @KangZhaoKui! You correctly diagnosed the root cause — float comparison with == on values like 0.1, 0.2, 0.3 fails due to IEEE 754 representation.

I've opened #6459 against the release/v0.85.0 branch with a slight variation: the tolerance is scaled by meta.appliedInterval so it adapts to the chart's value range (instead of a hardcoded 0.001, which would be too coarse for very small ranges and unnecessarily tight for very large ones). Closing this in favor of #6459 — credit to you in the changelog. Really appreciate the contribution! 🙏

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.

bug: LineChart left_axis labels display incomplete

3 participants