Algosim documentation: BarChart

BarChart

Creates a bar chart.

Syntax

Description

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

"category name": value

then BarChart(data) creates a bar chart with the categories given as data.

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

Examples

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

Image 1

BarChart(sort(frequencies(compute(RandomInt(1000000)^2, n, 1, 1000000) @ digits @ first)))

Image 2

Alice ≔ ExampleData("Alice in Wonderland");
BarChart(SortBy(frequencies(filter(characters(UpperCase(Alice)), ChrIsLetter)), (x ↦ −x[2])))

Image 3

See also