Shimoku docs
Search…
Pie Chart
You can use pie charts when you want to show differences within groups based on one variable. If you have categorical data then using a pie chart is a good choice.

The method to use

The method is shimoku.plt.pie()
It must contain the following input variables:
data: Union[str, DataFrame, List[Dict]]
x: str
y: str
menu_path: str
order: int
And accepts the following input variable as optional:
title: Optional[str]
rows_size: Optional[int]
cols_size: Optional[int]
padding: Optional[List[int]]

Video demonstration of the Pie chart

Pie chart settings and usage.

Examples

1. Default configuration

data_ = [
    {'name': 'Matcha Latte', 'value': 78},
    {'name': 'Milk Tea', 'value': 17},
    {'name': 'Cheese Cocoa', 'value': 18},
    {'name': 'Walnut Brownie', 'value': 9},
]
shimoku.plt.pie(
    data=data_,
    x='name', y='value',
    menu_path='test/pie-1',
    order=0,
rows_size=2, cols_size=12,
)
The result is:
The pie chart is in the default configuration.

2. Title for the chart, changing data, size and padding

data_ = [
{'name': 'Matcha Latte', 'value': 78},
{'name': 'Milk Tea', 'value': 17},
{'name': 'Cheese Cocoa', 'value': 18},
{'name': 'Walnut Brownie', 'value': 9},
{'name': 'Buckeye Brownie', 'value': 12},
]
shimoku.plt.pie(
data=data_,
x='name', y='value',
menu_path='test/pie-2',
order=0,
rows_size=2, cols_size=6,
padding='0,0,0,2',
title='Breakfast Delivery Preferences',
)
The result is:
Note the space before the component using padding='0,0,0,2', and size with cols_size=6.
Changing menu_path The menu_path can be modified.
It is possible to use any number of rows.
Last modified 3mo ago
Copy link
On this page
The method to use
Examples