minuit

DonutChartComponent

A pie or a donut with a legend.

Java

Inside a PanelComponent constructor. The same call draws in every family and chroma.

Java
DonutChartComponent ores = add(new DonutChartComponent(at(new Box("ores", 10, 10, 180, 80)))
        .centerLabel(words.get("mymod.blocks"))
        .otherLabel(words.get("mymod.other"))
        .onSelect(i -> open(i)));
ores.slice("Iron", 120).slice("Gold", 40).slice("Diamond", 7);

Variants

Donut

DonutChartComponent, donut

Pie

DonutChartComponent, pie