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

PieChart does not repsonse on touch with only one section #368

Closed
attex opened this issue Jun 3, 2020 · 4 comments
Closed

PieChart does not repsonse on touch with only one section #368

attex opened this issue Jun 3, 2020 · 4 comments
Labels
bug Something isn't working Pie Chart

Comments

@attex
Copy link

attex commented Jun 3, 2020

Hi there,

i recently faced an issue with the piechart.

PieChart( PieChartData( sections: _showingSections(data), pieTouchData: PieTouchData(touchCallback: (pieTouchResponse) { setState(() { if (pieTouchResponse != null && pieTouchResponse.touchInput is! FlPanEnd && pieTouchResponse.touchInput is! FlLongPressEnd) { _touchedIndex = pieTouchResponse.touchedSectionIndex; } }); }), borderData: FlBorderData( show: false, ), sectionsSpace: 0, centerSpaceRadius: 40, ), ),

When there is only one section the pieTouchResponse.touchedSectionIndex returns null.

Shouldn't it just return 0 ?

Thanks in advance

@imaNNeo
Copy link
Owner

imaNNeo commented Jun 29, 2020

Oh man, sorry about that,
It was an edge case, and thanks for reporting!

@imaNNeo imaNNeo added bug Something isn't working Pie Chart labels Jun 29, 2020
@imaNNeo
Copy link
Owner

imaNNeo commented Jun 29, 2020

It will be fixed in the new version.

@imaNNeo imaNNeo mentioned this issue Jun 29, 2020
@imaNNeo
Copy link
Owner

imaNNeo commented Jun 29, 2020

Check out the 0.10.1 version.
Cheers!

@imaNNeo imaNNeo closed this as completed Jun 29, 2020
@makss68
Copy link

makss68 commented Aug 21, 2020

The same issue occurs when there are multiple sections but only one of them has a non-zero value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Pie Chart
Projects
None yet
Development

No branches or pull requests

3 participants