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 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]]
Pie chart settings and usage.
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.
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
.It is possible to use any number of rows.
Last modified 8mo ago