xy_chart.md
62 lines · skills/markdown-mermaid-writing/references/diagrams/xy_chart.md at 5f2bc03
<!-- Source: https://github.com/SuperiorByteWorks-LLC/agent-project | License: Apache-2.0 | Author: Clayton Young / Superior Byte Works, LLC (Boreal Bytes) -->
XY Chart
Back to Style Guide — Read the style guide first for emoji, color, and accessibility rules.
Syntax keyword: xychart-beta Best for: Numeric data visualization, trends over time, bar/line comparisons, metric dashboards When NOT to use: Proportional breakdowns (use Pie), qualitative comparisons (use Quadrant)
Accessibility: Mermaid 12.0.0 emitsaccTitle/accDescrfor this type. Keep a visible description and verify older destination renderers.
Raw lines 1 to 14
Exemplar Diagram
XY chart comparing illustrative monthly revenue (bars) and operating cost (line), both in thousands of dollars; it does not measure per-customer acquisition cost:
xychart-beta
accTitle: Xy Chart Example
accDescr: Illustrative xy chart diagram; the surrounding text describes its data and relationships.
title "📈 Revenue and Operating Cost"
x-axis [Jan, Feb, Mar, Apr, May, Jun]
y-axis "Thousands ($)" 0 --> 120
bar "Revenue" [20, 35, 48, 62, 78, 95]
line "Operating cost" [50, 48, 45, 40, 35, 30]Raw lines 15 to 31
Tips
- Combine
barandlineonly when units and scale are compatible; preserve a data table and state that example values are illustrative - Use emoji in the title for visual flair:
"📈 Revenue Growth" - Use quoted
titleand axis labels - Define axis range with
min --> max - Keep data points to 6–12 for readability
- Multiple
barorlineentries add series; bars can overlap rather than group side by side. Named series such asline "Control" [1, 2]add a legend in v11.17.0+. Validate appearance on the actual host - Always pair with a detailed Markdown text description above for screen readers
Raw lines 32 to 43
Template
Description of what the X axis, Y axis, bars, and lines represent and the key insight:
xychart-beta
accTitle: Xy Chart Example
accDescr: Illustrative xy chart diagram; the surrounding text describes its data and relationships.
title "📊 Your Chart Title"
x-axis [Label1, Label2, Label3, Label4]
y-axis "Unit" 0 --> 100
bar "Observed" [25, 50, 75, 60]
line "Reference" [30, 45, 70, 55]Raw lines 44 to 59Verified reference
Syntax examples reviewed against official Mermaid documentation and rendered with Mermaid 12.0.0 (2026-10-01). Check the destination version; appearance and accessibility are not guaranteed by a successful parse.
Raw lines 60 to 62