Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Coxcomb プロットのクイックスタート

Coxcomb チャートは、スライスの角度は一定だが半径は一定ではない円グラフです。

Coxcomb.cs
ScottPlot.Plot myPlot = new();

List<PieSlice> slices = new()
{
    new() { Value = 5, Label = "赤", FillColor = Colors.Red },
    new() { Value = 2, Label = "オレンジ", FillColor = Colors.Orange },
    new() { Value = 8, Label = "金", FillColor = Colors.Gold },
    new() { Value = 4, Label = "緑", FillColor = Colors.Green.WithOpacity(0.5) },
    new() { Value = 8, Label = "青",  FillColor = Colors.Blue.WithOpacity(0.5) },
};

var cox = myPlot.Add.Coxcomb(slices);
cox.SliceLabelDistance = 1.5;

myPlot.Axes.Frameless();
myPlot.ShowLegend();
myPlot.HideGrid();

myPlot.SavePng("demo.png", 400, 300);
このレシピは、Coxcomb プロットカテゴリーにある多数のレシピの 1 つです