Spaces:
Sleeping
Sleeping
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| def plot_sales_tool(file_path: str) -> str: | |
| df = pd.read_csv(file_path) | |
| if 'Month' not in df.columns or 'Sales' not in df.columns: | |
| return "Missing 'Month' or 'Sales' columns." | |
| plt.figure(figsize=(10, 6)) | |
| plt.plot(df['Month'], df['Sales'], marker='o') | |
| plt.xticks(rotation=45) | |
| plt.title("Sales Trend") | |
| plt.savefig("sales_plot.png") | |
| return "Generated sales_plot.png" | |