File size: 368 Bytes
ea74d74 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import matplotlib.pyplot as plt
def generate_stock_chart(df):
df = df.sort_values(by="Stock")
plt.figure(figsize=(10, 6))
plt.barh(df["Product"], df["Stock"], color='skyblue')
plt.xlabel("Stock Quantity")
plt.title("Inventory Stock Distribution")
plt.tight_layout()
path = "/mnt/data/stock_chart.png"
plt.savefig(path)
return path
|