Skip to content

Positioning of overlapping labels in pie-chart #91

@mous-myndr

Description

@mous-myndr

I like the Graph library very much, just wanted the labels to be placed a bit better on small slices. See attached images the before/after screenshots: The before has the labels through each other, the second has that fixed. What I do, is I added an option 'label_position_delta_for_small_slices' => .1. I added some code in dataLabelPosition that looks at the degrees of a slice and the neighbour slices and adds or subtracts the amount given by the option if applicable.
Before:
Screenshot 2024-10-09 at 15 12 17
After:
Screenshot 2024-10-09 at 15 11 36
I have a clone of the repo with a pull request. I'm just not sure how to submit that here as a pull request...
See mous-myndr/SVGGraph#1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions