Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

pie chart problem with overlapping labels #2151

Copy link
Copy link
@RorellanaR

Description

@RorellanaR
Issue body actions

I'm creating a pie chart for a document using QuestPDF. The problem is that I'm displaying percentages in this chart, and the issue arises when there's a very high percentage; the other percentages get grouped together and overlap each other. I've tried separating them by adding or removing lines, but the small values ​​aren't displayed correctly.

`private static PlotModel CreatePieChart(string titulo, PieSlice[] data)
{
var model = new PlotModel
{
Title = titulo,
DefaultFont = "SourceSansPro",
TitleFont = "SourceSansPro",
SubtitleFont = "SourceSansPro",
DefaultFontSize = 8,
TitleFontSize = 8,
SubtitleFontSize = 8,
TextColor = OxyColor.Parse("#231f20"),
};

PieSeries? ps = new()
{
    StrokeThickness = .25,
    InsideLabelPosition = .25,
    AngleSpan = 360,
    StartAngle = 20,
    Font = "SourceSansPro",
    FontSize = 8,
    TextColor = OxyColor.Parse("#231f20"),
    TickRadialLength = 10,
    TickHorizontalLength = 15,
    InsideLabelFormat = "",
    OutsideLabelFormat = "{2:#0.00}%",
    TickLabelDistance = 5,
    InnerDiameter = 0.6,
};

foreach (var item in data)
{
    ps.Slices.Add(item);
}
model.Series.Add(ps);
return model;

}`

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.