import pandas as pd
from plotly import express as px
from plotly.colors import qualitative

data = pd.DataFrame(data={
    "name": ["headphones", "microphone", "speaker", "powerbank", "tablet", "laptop"],
    "price": [99.99, 49.99, 149.99, 29.99, 199.99, 279.99],
    "merchant": ["amazon", "amazon", "bestbuy", "amazon", "newegg", "amazon"],
    "color": ["black", "silver", "white", "red", "gray", "silver"]
})
figure = px.pie(data, values="price", names="name", title="Prix", color_discrete_sequence=qualitative.Bold)
figure.layout.update({"template": "seaborn", "title": "Prix à l'unité", "font": {"family": "Cabin", "size": 13}, "width": 1080, "height": 720})
figure.update_traces(textposition="inside", textinfo="percent+label", texttemplate="%{label}<br>%{value}€ (%{percent:.2%})")
figure.show()
