fix(flet-charts): match axis labels with float tolerance#6459
Merged
FeodorFitsner merged 2 commits intorelease/v0.85.0from May 1, 2026
Merged
fix(flet-charts): match axis labels with float tolerance#6459FeodorFitsner merged 2 commits intorelease/v0.85.0from
FeodorFitsner merged 2 commits intorelease/v0.85.0from
Conversation
Floating-point comparison with == fails for values like 0.1, 0.2, 0.3 due to IEEE 754 representation, causing custom ChartAxisLabel entries to silently disappear. Use a tolerance scaled by meta.appliedInterval so it adapts to the chart's value range. Fixes #6445
1 task
Deploying flet-examples with
|
| Latest commit: |
de4d17e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://0981239e.flet-examples.pages.dev |
| Branch Preview URL: | https://fix-chart-axis-label-float-p.flet-examples.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6445. Supersedes #6452 — thanks @KangZhaoKui for the original report and fix.
Description
ChartAxisLabelentries silently disappeared from the axis because labels were matched against tick values with==, which fails for doubles like0.1,0.2,0.3due to IEEE 754 representation.This change uses a tolerance-based comparison scaled by
meta.appliedInterval, so it adapts to the chart's value range instead of relying on a hardcoded epsilon.Type of change
Test plan
Summary by Sourcery
Bug Fixes: