Algosim documentation: PieChart


Creates a pie chart.



If data is a sequence or list of objects of the form

"category name": value

then PieChart(data) creates a pie chart with the categories given as data.

The chart is shown in the current diagram and a reference to the chart is returned.


PieChart("Cats": 4, "Dogs": 7, "Rats": 5, "Rabbits": 4)

Image 1

Alice ≔ ExampleData("Alice in Wonderland");
πc ≔ PieChart(
  '('("letters", ChrIsLetter),
    '("punctuation", ChrIsPunctuation),
    '("whitespace", ChrIsWhitespace)
  @ (x ↦ '(x[1], count(Alice, x[2])))
AdjustVisual(πc, "label position": 20, "value labels": false);

Image 2

See also