Chart Editor Help

Step-by-step setup for template charts and custom ECharts mode.

Back to Dashboards
Choose A Mode

Use Builder mode for guided filters and SQL generation. Use Raw SQL when you need full query control.

Validate Quickly

Use Compile, Dry Run, and Preview before saving to confirm SQL, columns, and chart shape.

Save Reusable Charts

After save, use Edit and Clone to iterate quickly from a working chart definition.

Template Charts (Fast Path)
  1. Select a chart template in Visual Builder.
  2. Choose Builder or Raw SQL mode.
  3. If Raw SQL is selected, paste query and click Compile.
  4. Click Dry Run to inspect columns and sample rows.
  5. Use Preview to confirm final rendering.
  6. Click Add Chart.
Custom ECharts (Advanced)

For Custom ECharts, three inputs are authoritative: Raw SQL, Custom Mapping JSON, and Custom Option JSON.

Raw SQL must include an explicit ORDER BY whenever point sequence matters (time series, ranked bars, top-N lists). Use a deterministic tie-breaker when needed (example: ORDER BY ts, service).

Placeholders in option JSON can use mapped keys (example: {{points}}) and built-ins ({{rows}}, {{records}}, {{columns}}).

Raw SQL
SELECT
  toStartOfMinute(Timestamp) AS ts,
  quantile(0.95)(Duration) AS p95_ms
FROM otel_traces
WHERE Timestamp >= now() - INTERVAL 2 HOUR
GROUP BY ts
ORDER BY ts
LIMIT 240
Mapping JSON
{
  "points": { "from": "rows" },
  "_drilldown": {
    "target": "traces",
    "label": "Open source traces",
    "extra": { "service": "{{service}}" }
  }
}
Option JSON
{
  "xAxis": { "type": "time" },
  "yAxis": { "type": "value" },
  "series": [
    { "type": "line", "data": "{{points}}", "smooth": true }
  ]
}
Visual References
Dashboard view screenshot
Dashboard overview
Logs view screenshot
Logs drilldown target
Traces view screenshot
Traces drilldown target
Full copy/paste payloads are available in examples/custom_echarts. Ensure every custom SQL query has explicit ORDER BY for deterministic chart output.