Charts: preview
charts_previewPreview the rows a chart configuration would plot against current project data without saving, so you can validate entity, grouping, measure and filters before creating it.
Instructions
Show the data a chart configuration would draw, without saving it. Runs a chart configuration against the project's current data and shows the points, totals or rows it would plot, trimmed to rows. Use it to settle entity, grouping, measure and filters before charts_create or charts_update; for a chart already saved, use dashboards_widget_preview. Returns JSON.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | End of a custom time window, e.g. 2026-03-31 | |
| agg | No | How to combine the --measure values: count (default), sum, avg, min or max | |
| from | No | Start of a custom time window, e.g. 2026-01-01 | |
| rows | No | Most rows or points to show (default 50) | |
| sort | No | Sort direction: asc or desc | |
| type | No | Chart type: column (bar chart), line, pie, area, stat, gauge or funnel | |
| limit | No | Most points or rows to plot | |
| config | No | Other chart settings as a JSON object, e.g. {"limit":10,"target":500} or funnelStages for a funnel. Typed options win over this. Setting names can be camelCase or snake_case | |
| entity | No | Entity whose records the chart plots (for an entity chart) | |
| filter | No | Filter as field:operator:value, e.g. status:eq:published. Operators: eq, ne, gt, gte, lt, lte, contains, in, exists, not_exists. Repeat for several fields. Replaces the chart's existing filters | |
| source | No | Where the data comes from: entity (default), platform (usage metrics) or quota (plan limits) | |
| target | No | Goal or warning level drawn on a stat or gauge | |
| compare | No | Compare with the previous period (true/false) | |
| measure | No | Numeric field to aggregate (needed unless --agg is count) | |
| group_by | No | Field for the x axis, or the slices of a pie. A date field is bucketed with --interval | |
| interval | No | Bucket size for a date --group-by: hour, day, week, month, quarter or year | |
| stack_by | No | Field that splits each bar or point into a second breakdown | |
| timeframe | No | Time window: all, 24h, 7d, 30d, 90d, 365d or custom | |
| cumulative | No | Plot a running total (true/false) | |
| target_mode | No | What --target means: goal or warning | |
| compare_days | No | How many days back the comparison period starts (defaults to the length of the time window) | |
| quota_metric | No | Plan limit for a quota chart: storage, files, users, workflows or emails | |
| compare_overlay | No | Draw the previous period over the current one (true/false) | |
| platform_metric | No | Usage metric for a platform chart. List them with: charts platform-metrics | |
| platform_period | No | Window for a platform metric: day, week, month, quarter or year |