← All toolsFinance & Analysisanalyst_toolsAll editions

GENERATE_CHART_IMAGE

Generates a beautiful, high-quality PNG chart (bar, line, scatter, pie, or heatmap) from a dataset using matplotlib and seaborn. Perfect for visual analysis. Saves the image to the specified path.

Parameters

NameTypeRequiredDescription
input_pathstringyesAbsolute path to the dataset (CSV/Excel).
output_pathstringyesAbsolute path to save the .png file (e.g., ~/Desktop/sales_chart.png).
chart_typebar | line | scatter | pie | heatmapyesType of chart to generate.
x_columnstringβ€”Column name to use for the X-axis (or labels for pie charts). Not needed for heatmap.
y_columnstringβ€”Column name to use for the Y-axis (or values for pie charts). Not needed for heatmap.
titlestringβ€”Title of the chart.
color_themestringβ€”Optional seaborn palette name (e.g., 'viridis', 'magma', 'coolwarm', 'Blues', 'Set2').

How to use it

You normally trigger this by describing what you want in chat β€” the agent selects GENERATE_CHART_IMAGE automatically. For example:

Try saying
β€œuse analyst tools to generate …”

In a workflow

As a step in a multi-step workflow DAG:

json
{
  "id": "s1",
  "agent": "analyst_tools",
  "action": "GENERATE_CHART_IMAGE",
  "args": {
    "input_path": "/Users/me/Documents/file.txt",
    "output_path": "/Users/me/Documents/file.txt",
    "chart_type": "bar"
  },
  "depends_on": [],
  "outputs": []
}

Direct call

For scripting, call it directly via POST /execute_tool. Every tool returns { success, message, data }.

bash
curl -X POST http://127.0.0.1:8000/execute_tool \
  -H "Content-Type: application/json" \
  -d '{"tool_name":"GENERATE_CHART_IMAGE","args":{"input_path":"/Users/me/Documents/file.txt","output_path":"/Users/me/Documents/file.txt","chart_type":"bar"}}'

Part of the analyst_tools plugin. Browse the full Plugin & Tool Catalog or the relevant feature guide.