Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pie Chart Connector Lines feature #1732

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

amirk3321
Copy link

@amirk3321 amirk3321 commented Aug 25, 2024

Hello,

I added a new feature to fl_chart package. Now, developers can use FLConnectorLineSettings to configure line pointing the value for PieChartSectionData.

Example PieChartSectionData to draw connector line pointing the value:

PieChartSectionData(
  connectorLineSettings: const FLConnectorLineSettings(
          type: FLConnectorType.line,
          color: Color(0xFFD5E5EC), // use any color,
          length: "40%" // use any length
  ),
);

The line results:

Screenshot 2024-08-25 at 12 47 04 PM

The connectorLineSettings field in PieChartSectionData is nullable, so simply remove it if you don't want to use it.

The suggestions, bugs, or contribution to the enhancements of these lines would be greatly appreciated.

Thanks

Fixes #1731

@cogivn
Copy link

cogivn commented Aug 26, 2024

Hi @amirk3321, I also need this feature on my app.
Can we add more customization like ability to customize external labels? Something like this...
Thank you so much,

centerSpaceRadius = centerSpaceRadius ?? double.infinity,
centerSpaceColor = centerSpaceColor ?? Colors.transparent,
sectionsSpace = sectionsSpace ?? 2,
startDegreeOffset = startDegreeOffset ?? 0,
pieTouchData = pieTouchData ?? PieTouchData(),
titleSunbeamLayout = titleSunbeamLayout ?? false,
super(
borderData: borderData ?? FlBorderData(show: false),
touchData: pieTouchData ?? PieTouchData(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have some formatting changes. For example here

@@ -112,7 +113,7 @@ class PieChartData extends BaseChartData with EquatableMixin {
pieTouchData: b.pieTouchData,
sectionsSpace: lerpDouble(a.sectionsSpace, b.sectionsSpace, t),
startDegreeOffset:
lerpDouble(a.startDegreeOffset, b.startDegreeOffset, t),
lerpDouble(a.startDegreeOffset, b.startDegreeOffset, t),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

mouseCursorResolver,
longPressDuration,
);
enabled ?? true,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here

@imaNNeo
Copy link
Owner

imaNNeo commented Nov 20, 2024

These changes caused some conflicts in your branch. Please revert all the formatting changes

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.

Need arrow line to pie chart section title
3 participants