Pie

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 s.plt.pie()

It must contain the following input variables:

order: int
names: str
values: str
data: Union[str, DataFrame, List[Dict]]

And accepts the following input variable as optional:

title: Optional[str]
rows_size: Optional[int]
cols_size: Optional[int] 
padding: Optional[List[int]]
option_modifications: Optional[Dict]

Video demonstration of the Pie chart

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},
]

s.plt.pie(
    data=data, names='name', values='value',
    order=0, rows_size=2, cols_size=12,
)

2. Customization And Context

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},
]

s.plt.pie(
    data=data, names='name', values='value',
    order=0, rows_size=2, cols_size=6,
    padding='0,0,0,2', title='Breakfast Delivery Preferences',
)

Changing the Menu Path The menu_path can be modified.

Using the Grid

It is possible to use any number of rows.

Last updated