Skip to content

test(charts): cover sub-1 bar label formatting - #36483

Draft
AKnassa wants to merge 1 commit into
microsoft:masterfrom
AKnassa:ak-issue-30213-vbc-decimal-labels
Draft

test(charts): cover sub-1 bar label formatting#36483
AKnassa wants to merge 1 commit into
microsoft:masterfrom
AKnassa:ak-issue-30213-vbc-decimal-labels

Conversation

@AKnassa

@AKnassa AKnassa commented Aug 1, 2026

Copy link
Copy Markdown

Previous Behavior

This issue reported bar chart labels showing "900m" when the value was 0.9 (the "m" means milli, so 0.9 kg looked like 900 mg — very confusing). That bug was actually fixed on master by #34562, but nothing tested it, so it could quietly come back.

New Behavior

No product code changes — this PR adds the missing safety net. New tests lock in that small values render as plain decimals ("0.9", not "900m") in both charting packages, including a rendering test that checks the actual label text on VerticalBarChart bars.

With the tests proving the fix is in place, this issue can be closed; anyone still seeing "900m" just needs to upgrade (@fluentui/react-charts 9.0.7+ / @fluentui/react-charting 5.24.1+).

What changed

  • Unit tests for the number formatter (values under 1) in v9 react-charts and v8 react-charting.
  • A VerticalBarChart test asserting bar labels read "0.9" and "0.18" for fractional data.
  • Release-notes change files (type "none" — tests only).

We confirmed the old formatter really did produce "900m" for 0.9, and that the full react-charts suite stays green (the only failures are 6 HeatMap snapshots that were already failing on untouched master).

Related Issue(s)

Issue microsoft#30213 reported VerticalBarChart labels rendering 0.9 as
'900m' (d3 SI prefix, m = milli). The formatter rewrite in PR microsoft#34562
already fixed this on master (shipped in @fluentui/react-charts 9.0.7
and @fluentui/react-charting 5.24.1), but nothing asserted the sub-1
behavior, so it could silently regress.

Lock it in with regression tests: formatScientificLimitWidth unit
coverage for |value| < 1 in both charting packages, plus a
VerticalBarChart render test asserting bar label text for fractional
data. Verified the historic bug reproduces through the pre-microsoft#34562
formatter and that current code passes.

The issue can be closed as fixed; reporters on older package
versions should upgrade.

Closes microsoft#30213
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]: [@fluentui/react-chart][Vertical-Bar-chart] show wrong data when the value for Y is less than 1

1 participant