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