← All updates

Scatter plots in templates

chart() now draws scatter plots with type "scatter" — a point per row on two numeric value axes, with optional x-min/x-max bounds and generated alt text.

dslbuildercharts

The chart() builder now supports type: "scatter". Give x a numeric row field and y one or more value fields, and every row becomes a filled point on two value axes — price vs volume, response time vs load, score vs hours. It is the first chart type whose x axis is a value axis rather than a category list.

chart({
  type: "scatter",
  data: "{{samples}}",
  x: "load",
  y: { key: "ms", label: "Response time" },
  width: 480,
  height: 220,
  "x-min": 0,
  "x-max": 100,
});

Both axes auto-fit the plotted points, so a scatter plot never gets the forced zero that bars use. x-min / x-max bound the x axis the same way y-min / y-max bound the y axis — and they are a build-time error on chart types whose x axis is categorical. Multiple y series share the same x field and are drawn in their palette colours.

Rows whose x or y is missing or non-numeric are skipped with an invalid-chart-data warning, never plotted at zero. The generated alt text lists (x, y) pairs per series, capped at 60 points per series, so screen readers get the same relationship the chart shows.

Available through POST /api/v1/preview and POST /api/v1/render. Full details in pdf-template-author.md §Charts.