Semicircle (concave/convex) shaped piechart slices#125
Merged
gsteckman merged 4 commits intoAug 30, 2025
Merged
Conversation
- Concave/convex semicircle shaped endings - Nearly exact API as DefaultSlice except doesn't accept BorderStroke - Gaps can lead to negative sweep angles which cause rendering issues; only rendering positive angles
Contributor
Author
|
Ohhh, I just saw there's a copyright tag in the source code which originates from my default Android Studio settings. I'll remove this in a few minutes. |
gsteckman
reviewed
Aug 24, 2025
Member
gsteckman
left a comment
There was a problem hiding this comment.
Thanks for the contribution. Please run detekt and correct any code style errors it finds. Expanding on hover does not produce a nice effect, in my opinion...maybe it should be disabled for this type of slice shape? Another option could be to make it thicker on hover. That might look ok, given a big enough hole size.
- adding gap argument comment - extracting inner circle sweep angle constant - slices don't expand on hover event - fixing detekt's argument number constraint by introducing parameter data classes - gap cannot be negative `require` constraint
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
When I was looking for a CMP chart library I needed to keep style specifications in mind which are established in an app I'm currently working on. One of these are rounded slices in pie charts. I've first encountered this functionality when I was using MPAndroidChart.
Since koalaplot has been designed with a straighforward approach of providing custom rendering, providing a
Shapeimplementation was relatively easy but at the same time none-trivial. This is why I think it is best to share this addition with everyone.Description
DefaultSliceexcept doesn't acceptBorderStrokeThe following screenshot illustrates the basic thought behind this feature.
Current limitations
To reduce mental load, I'm using 3 distinct paths which are finally combined with
addPath. This however treats them as 3 seperate paths, which causes issues whenBorderStrokeis applied, which is why I decided to abandon this for the moment.