Skip to content

fix!: Remove non-functional borderData from PieChartData#2066

Open
mahmoodhamdi wants to merge 1 commit intoimaNNeo:mainfrom
mahmoodhamdi:fix/issue-1182-remove-pie-borderdata
Open

fix!: Remove non-functional borderData from PieChartData#2066
mahmoodhamdi wants to merge 1 commit intoimaNNeo:mainfrom
mahmoodhamdi:fix/issue-1182-remove-pie-borderdata

Conversation

@mahmoodhamdi
Copy link
Copy Markdown

Problem

PieChartData inherits borderData from BaseChartData, but PieChartPainter never uses it to draw any borders. When users set borderData: FlBorderData(show: true) on a PieChartData, nothing happens — the parameter is silently ignored.

This was reported in #1182 and confirmed by the maintainer.

Solution

Removed the borderData parameter from PieChartData:

  • Removed from constructor, copyWith, lerp, and props
  • PieChartData now always passes FlBorderData(show: false) to BaseChartData
  • Updated documentation, example app, and tests

Users should use PieChartSectionData.borderSide for section borders.

Breaking Change

Code that passes borderData to PieChartData(...) will get a compile error. The fix is to simply remove the borderData parameter — it was never functional.

Migration:

// Before
PieChartData(
  borderData: FlBorderData(show: false), // remove this
  sections: [...],
);

// After
PieChartData(
  sections: [...],
);

Testing

  • All 573 existing tests pass
  • flutter analyze — zero warnings
  • make checkstyle — passes
  • Removed tests that validated borderData equality on PieChartData

Checklist

  • flutter analyze passes with zero warnings
  • flutter test passes (573 tests)
  • dart format . applied
  • CHANGELOG.md updated

Closes #1182

The borderData parameter inherited from BaseChartData was never used
by PieChartPainter to draw any borders. Users should use
PieChartSectionData.borderSide instead for section borders.

Removed borderData from PieChartData constructor, copyWith, lerp,
and equality props. Updated docs, examples, and tests accordingly.

Closes imaNNeo#1182
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (d3a8ac2) to head (e0e5a9a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2066   +/-   ##
=======================================
  Coverage   92.92%   92.92%           
=======================================
  Files          50       50           
  Lines        3873     3873           
=======================================
  Hits         3599     3599           
  Misses        274      274           
Flag Coverage Δ
flutter 92.92% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@imaNNeo
Copy link
Copy Markdown
Owner

imaNNeo commented Apr 10, 2026

Comment from here:

Removing it will cause a breaking change for users who are using this property (even though it doesn't do anything).

On the other hand, I think there might be a use case where users want to have a rectangular border around the chart, and they can use this property. This way, we keep it consistent with the other chart types (as we have it intentionally in our BaseChartData).

I'm sorry, but I was wrong in my previous comment. Now I'm seeing it from a different perspective. Let's keep it and make it functional.

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.

PieChartData->borderData not working

2 participants