How to chart a metrics view with the create_chart tool, which chart type fits which question, and the pitfalls that produce misleading charts
86%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
The create_chart tool draws a chart from a metrics view. You describe the chart (chart_spec: a chart type and which field goes on which channel) and what to query (data: the metrics view, time range, grain and filter); Rill runs the query, formats the measures and renders the chart. Never pass rows, colors or axis settings. The tool description lists the chart types, their channels and the argument shape.
get_metrics_view for the measures, dimensions and the time dimension, and reference them by their exact names.query_metrics_view whenever the shape matters: how many distinct values a dimension has, whether a measure is a count, an amount or a rate, and whether a dimension mixes a total with its parts. Chart one level, never a total next to its parts.limit, and split with row or column facets instead of piling categories onto color.y or a dimension on color; Area Chart to stack parts; Bump Chart for ranks; Slope Chart for two periods.data.comparison_time_range on a Line, Area, Bar, Grouped Bar, Lollipop or Slope Chart with one measure and nothing on color (or group); the previous period is drawn as a second series.color; Grouped Bar Chart with the clustering dimension on group; Bar Table for many categories with value labels; Lollipop Chart for a ranking.size and the dimension on color, innerRadius for a donut; only for a handful of values that add up to a whole.x and the signed change on y; leave color unbound, it is reserved for a start/delta/end type field.detail, optional size and color; Heatmap for two dimensions and one measure.detail.Set title to the finding in a sentence and subtitle to what is measured, of whom, when and in what unit, for example "Spend fell 18% after the March price change" over "Daily total spend by device, Jan–Apr 2024, USD". Axes and legends take their labels from the metrics view, so do not restate field names.
color; values compared side by side go on a Grouped Bar Chart with group. A Bar Chart with a second dimension on color stacks.row facets or separate charts.color is unreadable; use limit, a Bar Table or facets.time_grain or lower the limits and create the chart again.rilldata/agent-skills
37cf850
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.