-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Issue:
The position of the first slice on a coxcomb chart moves depending on the number of slices in the chart. Even if the Rotation property is set to 0. This is different to the pie chart where the first slice is always in the same place.
| # | Pie | Coxcomb |
|---|---|---|
| 3 | ![]() |
![]() |
| 4 | ![]() |
![]() |
| 5 | ![]() |
![]() |
Expected behavior: the position of the first slice is always in the same page.
ScottPlot Version: 5.0.39
Code Sample:
double[] values = { 5, 2, 8, 4, 8 };
for (int j = 3; j <= 5; j++)
{
ScottPlot.Plot myPlot1 = new();
myPlot1.Add.Pie(values.Take(j));
myPlot1.SavePng("pie" + j + ".png", 400, 300);
ScottPlot.Plot myPlot2 = new();
myPlot2.Add.Coxcomb(values.Take(j));
myPlot2.SavePng("coxcomb" + j + ".png", 400, 300);
}I think the problem might be the first canvas rotation is done twice:
ScottPlot/src/ScottPlot5/ScottPlot5/Plottables/Coxcomb.cs
Lines 51 to 55 in 743c942
| rp.Canvas.RotateDegrees(startAngle); | |
| for (int i = 0; i < Slices.Count; i++) | |
| { | |
| rp.Canvas.RotateDegrees(rotationPerSlice); |
so moving line 55 to the end of the for block might fix it
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels





