The most common business-report chart is a combo: bars for an amount, a line for a rate on its own scale. chart() now supports both. Give a y series type: "line" and axis: "right" and it draws as a line measured against a right-hand value axis, while the other series stay bars on the left.
chart({
type: "bar",
data: "{{monthly}}",
x: "month",
y: [
{ key: "revenue", label: "Revenue" },
{ key: "margin", label: "Margin %", type: "line", axis: "right" },
],
"y2-title": "Margin %",
"y2-min": 0,
"y2-max": 40,
width: 480,
height: 220,
});
Bar series always draw first — grouped, or stacked with stacked: true — and lines draw on top. The right axis appears only when a series asks for it, computes its own nice ticks from those series' values, and is titled and bounded by the new y2-title, y2-min and y2-max options. The legend and generated alt text mark right-axis series with "(right axis)", and the combined chart reads "Combined bar and line chart" for screen readers. Setting any y2-* option without a right-axis series is an error, as is a per-series type or axis on a pie chart, and on a horizontal bar chart (which draws bars only).
The stacked per-category total in the alt text now counts bar series only, since a line on the right axis is a different scale. Full option list: pdf-template-author.md §Charts.