Skip to content

Pie: Customize slice label position #2515

@swharden

Description

@swharden

Presently labels are centered on pie slices:

https://scottplot.net/cookbook/4.1/category/plottable-pie/#slice-values

// record where and what to label the slice
double sliceLabelR = 0.35 * diameterPixels;
labelXs[i] = (boundingRectangle.X + diameterPixels / 2 + xOffset + Math.Cos(angle) * sliceLabelR);
labelYs[i] = (boundingRectangle.Y + diameterPixels / 2 + yOffset + Math.Sin(angle) * sliceLabelR);

However, it would be great if label position (radius) could be customized with a public property to let users customize its placement. This in combination with being able to customize the size of the pie radius would allow users to place labels outside the pie.

This idea came from a question from @nuelle16 in #2510

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions