Skip to main content

Pie chart

Pie charts are another common tool for categorical data when we want to show the proportion that each category occupies out of the whole.

Syntax

pie_chart(Statistics_data)

Description

It draws a pie chart for a data sample.

graphics.pie_chart.calc.png
graphics.pie_chart.plotter.calc.png

Options

Option

Description

Format

Default value

clockwise

When set to true, input data values are plotted in clockwise order. If false, values are plotted counterclockwise.

Boolean.

false

color

Sets the color for the outline of pie slices.

RGB list of values {r,g,b} where r, g, and b are integers between 0-255. Alternatively, one of the following strings: black, white, red, green, blue, cyan, magenta, yellow, brown, orange, pink, grey, dark_grey, light_grey, or one of the HTML colors, by name (e.g. html_indigo rather than 4b0082).

{66,66,66}

fill_color

Sets the color for the interior of each pie slice. Each new color is plotted in the order that it appears, and if fewer colors than data values are provided, the list wraps around.

A list of colors {color1,color2,...} where each color follows the format described in the color option.

auto (a predetermined color scheme)

labels

Provides labels for each pie slice, displayed next to the slices. These replace the default labels.

A list of Strings.

auto (each slice is labelled with its value)

pie_radius

Sets the radius of the whole pie chart.

Positive Float

1

starting_angle

An angle in radians that indicates at which angle to start plotting the first pie slice. Degrees can be used if they are followed by the degree symbol.

Float.

auto (zero)

title

Title of the pie chart, to be shown above it.

String.

"" (empty string)