Chart a Postgres query result in one prompt
When to use: You just ran a query; next natural step is 'show me this as a bar chart'.
Prerequisites
- Data as rows (from any other MCP or pasted) — Usually output of a postgres/mongodb/duckdb query
Flow
-
Pick the right chart typeGiven this data [paste rows with category + value], which AntV chart fits best? Options: bar, column, pie, line.✓ Copied→ Justified pick (e.g. 'column — category vs value, ≤20 categories')
-
RenderGenerate a column chart with x=category, y=value, title '<Title>'. Return the image URL.✓ Copied→ URL or base64 image
-
Iterate on styleSame chart but sort bars by value desc, add data labels, use a single color (teal).✓ Copied→ Refined chart image
Outcome: A report-ready chart image in 30 seconds without touching a plotting library.
Pitfalls
- Too many categories makes a bar chart unreadable — Cap at top 15 + 'Other'; use a treemap or heatmap for higher-cardinality data