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

[Bug] Donut and pie chart renders outside the canvas. #317

Open
blogcraft opened this issue Jun 13, 2022 · 1 comment
Open

[Bug] Donut and pie chart renders outside the canvas. #317

blogcraft opened this issue Jun 13, 2022 · 1 comment
Labels

Comments

@blogcraft
Copy link

Describe the bug
I am doing a PDF Web API with Quest PDF.
When I try to create a Donut (or pie) chart on the canvas it renders bad.

Which platform and version is this for?
example: .NET 6 Web API With Quest PDF

image

I am testing with version 0.9.5.9 and this is how it renders:
image

(The green Background is to show the canvas)
I'm using QuestPDF to render the canvas.

 var entries = new[]
{
    new ChartEntry(212)
    {
        Label = "UWP",
        ValueLabel = "112",
        Color = SKColor.Parse("#2c3e50")
    },
    new ChartEntry(248)
    {
        Label = "Android",
        ValueLabel = "648",
        Color = SKColor.Parse("#77d065")
    },
    new ChartEntry(128)
    {
        Label = "iOS",
        ValueLabel = "428",
        Color = SKColor.Parse("#b455b6")
    },
    new ChartEntry(514)
    {
        Label = "Forms",
        ValueLabel = "214",
        Color = SKColor.Parse("#3498db")
    }
};

...

.Canvas((canvas, size) =>
{
    var chart = new DonutChart
    {
        Entries = entries,
        IsAnimated = false,
    };

    chart.DrawContent(canvas, (int)size.Width, (int)size.Height);
});

@blogcraft
Copy link
Author

Also, the chart is upside down, its starting to draw the segments at 6 o'clock instead 12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant