Copy an example, or open it in the live editor with this diagram already loaded.
Quarterly revenue bars
One bar per category. The y-axis range is explicit so the bars do not sit on a scale that starts at zero by surprise.
xychart-beta
title "Quarterly revenue"
x-axis [Q1, Q2, Q3, Q4]
y-axis "Revenue ($k)" 0 --> 120
bar [40, 55, 70, 90]
Latency as a line
A line is the same list of numbers with line instead of bar. Use it when the categories are ordered, such as months.
xychart-beta
title "Checkout p95"
x-axis [Jan, Feb, Mar, Apr]
y-axis "Milliseconds" 0 --> 500
line [420, 380, 260, 210]
Bars with a trend line
bar and line can share a chart. Use the same number of values as there are x-axis labels.
xychart-beta
title "Weekly signups"
x-axis [Mon, Tue, Wed, Thu, Fri]
y-axis "Signups" 0 --> 40
bar [12, 18, 15, 22, 30]
line [12, 18, 15, 22, 30]