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 show value on Click #496

Closed
waqaryounusjatt788 opened this issue Nov 12, 2020 · 2 comments
Closed

Pie chart show value on Click #496

waqaryounusjatt788 opened this issue Nov 12, 2020 · 2 comments
Labels
Pie Chart question Further information is requested

Comments

@waqaryounusjatt788
Copy link

I have set custom Text in Center Space of Pie Chart when i am pressing long click then value is showing but i want this thing on click event please see below sample.
sd

@animalnots
Copy link

animalnots commented Nov 27, 2020

@waqaryounusjatt788 ,
You can do that by commenting out the default code and adding custom handler logic.

PieChartData(
pieTouchData: PieTouchData(
touchCallback: (pieTouchResponse) {
setState(() {
touchedIndex =
pieTouchResponse.touchedSectionIndex ??
touchedIndex;

                                // if (pieTouchResponse.touchInput
                                //         is FlLongPressEnd ||
                                //     pieTouchResponse.touchInput is FlPanEnd) {
                                //   touchedIndex = -1;
                                // } else {
                                //   touchedIndex =
                                //       pieTouchResponse.touchedSectionIndex;
                                // }
                              });
                            }),
                            borderData: FlBorderData(
                              show: false,
                            ),
                            sectionsSpace: 3,
                            centerSpaceRadius: 60,
                            sections: showingSections(
                                state.maintenanceCostResult)),
                      ),

Edit: github code markup is broken :/

@imaNNeo
Copy link
Owner

imaNNeo commented Jan 30, 2023

Check it out here:

pie.mov

@imaNNeo imaNNeo closed this as completed Jan 30, 2023
@imaNNeo imaNNeo added question Further information is requested Pie Chart labels Jan 30, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pie Chart question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants