Untitled
unknown
plain_text
a year ago
892 B
5
Indexable
import matplotlib.pyplot as plt # Data categories = ["Elektroshtepiake te medha", "Frigorifere", "TV", "Kompjutera", "Elektroshtepiake te vogla"] sales = [800000, 550000, 650000, 730000, 440000] # Calculate total sales and percentage of sales total_sales = sum(sales) sales_percentage = [(s / total_sales) * 100 for s in sales] # Create the pie chart fig, ax = plt.subplots(figsize=(8, 8)) wedges, texts, autotexts = ax.pie(sales, labels=categories, autopct="%1.1f%%", startangle=140, colors=['blue', 'green', 'red', 'purple', 'orange'], wedgeprops=dict(width=0.3)) # Add a central white circle to create a donut chart centre_circle = plt.Circle((0, 0), 0.7, fc="white") fig.gca().add_artist(centre_circle) # Title plt.title('% e shitjeve te produkteve ne dyqan') # Display the chart plt.show()
Editor is loading...
Leave a Comment