Install
openclaw skills install sql-to-dashboardUse when (1) user provides a SQL query and asks to generate a chart, dashboard, or data visualization from the results. (2) user says "show this as a graph", "make a dashboard from this query", "visualize the results", or "plot this data". (3) user has a query result and wants a visual summary rather than raw rows.
openclaw skills install sql-to-dashboardUse when (1) user provides a SQL query and asks to generate a chart, dashboard, or data visualization from the results. (2) user says "show this as a graph", "make a dashboard from this query", "visualize the results", or "plot this data". (3) user has a query result and wants a visual summary rather than raw rows.
This skill solves the specific problem of: SQL query results are rows and columns — a visual chart makes trends, comparisons, and anomalies immediately visible.
This skill IS NOT:
This skill IS activated ONLY when: SQL query or result set + visualization/dashboard intent are both present.
/sql-to-dashboardDefault mode. Takes a SQL query or result set and outputs a chart specification.
When to use: User provides SQL and wants to see the data as a chart.
/sql-to-dashboard/multiCombines multiple queries into a single dashboard with multiple panels.
When to use: User has several related metrics they want on one screen.
SELECT columns → X-axis candidates (time, category) or Y-axis (numeric values)GROUP BY → X-axis or legend groupingsORDER BY with LIMIT → top-N pattern, suggest horizontal bar chartCOUNT, SUM, AVG aggregates → Y-axis values| Query Pattern | Chart Type | Reason |
|---|---|---|
| Time series (GROUP BY date) | Line chart | Shows trend over time |
| Top-N with COUNT/SUM | Horizontal bar | Easy to compare magnitudes |
| Pie/sum by category | Pie or donut | Shows proportion |
| Two numeric columns | Scatter plot | Shows correlation |
| Multiple aggregates | Grouped bar | Compares categories across groups |
| Cumulative sum | Area chart | Shows accumulation |
| Yes/No count | Donut chart | Binary proportion |
Output a specification in a format appropriate to context:
Plotly JSON spec:
{
"data": [{
"x": ["Jan","Feb","Mar"],
"y": [120, 80, 150],
"type": "scatter",
"mode": "lines+markers",
"name": "Revenue"
}],
"layout": {
"title": "Monthly Revenue",
"xaxis": {"title": "Month"},
"yaxis": {"title": "Revenue ($)"}
}
}
Grafana panel JSON:
{
"title": "Monthly Revenue",
"targets": [{"expr": "sum(revenue)"}],
"fieldConfig": {"defaults": {"unit": "currencyUSD"}}
}
Mermaid (for simple data):
xychart-beta
title "Monthly Revenue"
x-axis [Jan, Feb, Mar]
y-axis "Revenue ($)" 0 --> 200
line [120, 80, 150]
A good output:
A bad output:
| Scenario | Bad Output | Good Output |
|---|---|---|
SELECT date, COUNT(*) grouped by month | Bar chart | Line chart (time series = trend) |
SELECT status, COUNT(*) 3 statuses | 3D pie chart | Donut chart with legend |
| Empty result set | Empty chart rendered | "Query returned 0 rows — no chart to display" |
| Very large result (10k rows) | Renders all 10k points | Aggregates or samples — states "showing top 100" |
references/ — Chart type decision tree, Plotly/Grafana/Redash spec templates, dashboard best practices