Chart a Postgres query result in one prompt
Когда использовать: You just ran a query; next natural step is 'show me this as a bar chart'.
Предварительные требования
- Data as rows (from any other MCP or pasted) — Usually output of a postgres/mongodb/duckdb query
Поток
-
Pick the right chart typeGiven this data [paste rows with category + value], which AntV chart fits best? Options: bar, column, pie, line.✓ Скопировано→ 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.✓ Скопировано→ URL or base64 image
-
Iterate on styleSame chart but sort bars by value desc, add data labels, use a single color (teal).✓ Скопировано→ Refined chart image
Итог: A report-ready chart image in 30 seconds without touching a plotting library.
Подводные камни
- Too many categories makes a bar chart unreadable — Cap at top 15 + 'Other'; use a treemap or heatmap for higher-cardinality data