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

Crashes when sum of data is 0 #101

Open
sayemoid opened this issue Nov 27, 2023 · 0 comments
Open

Crashes when sum of data is 0 #101

sayemoid opened this issue Nov 27, 2023 · 0 comments

Comments

@sayemoid
Copy link

java.lang.IllegalStateException: Offset is unspecified at androidx.compose.ui.geometry.Offset.getX-impl(Offset.kt:67) at com.aay.compose.donutChart.component.PiePedigreeChartKt.drawPedigreeChart-88mDfTA(PiePedigreeChart.kt:62) at com.aay.compose.donutChart.PieChartKt$drawPieChart$1.invoke(PieChart.kt:168) at com.aay.compose.donutChart.PieChartKt$drawPieChart$1.invoke(PieChart.kt:159) at androidx.compose.ui.draw.DrawBackgroundModifier.draw(DrawModifier.kt:116)
This particularly happens when the sum of the data is 0.

I'm using version Beta-0.0.5.

May be a check here would resolve the issue?

if (pieChartData.sumOf { it.data } <= 0) return

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

No branches or pull requests

1 participant