Description
When rendering an xychart with long category labels on the x-axis, the labels overlap without any layout mitigation (rotation, truncation, or wrapping). This results in unreadable axis text and poor chart usability.
Steps to reproduce
- Create an XY chart with long category labels
- Open the chart in browser http://localhost:9000/xychart.html
- Observe the x-axis labels
Screenshots
Code Sample
xychart
title "Category Overlap Demo"
x-axis [
"Category 1 - Lorem ipsum dolor sit amet",
"Category 2 - Consectetur adipiscing elit sed do eiusmod",
"Category 3 - Tempor incididunt ut labore et dolore magna aliqua",
"Category 4 - Ut enim ad minim veniam quis nostrud exercitation"
]
y-axis 0 --> 150
bar [52, 96, 35, 10]
Setup
- Mermaid version: 11.13.0
- Browser and Version: Chrome
Suggested Solutions
Rotate labels by 45° when they exceed available slot width.
Truncate with ellipsis to slot width.
Additional Context
This affects readability and usability of XY charts in real-world datasets where category names are often long ( product names, descriptions, logs).
Description
When rendering an xychart with long category labels on the x-axis, the labels overlap without any layout mitigation (rotation, truncation, or wrapping). This results in unreadable axis text and poor chart usability.
Steps to reproduce
Screenshots
Code Sample
Setup
Suggested Solutions
Rotate labels by 45° when they exceed available slot width.
Truncate with ellipsis to slot width.
Additional Context
This affects readability and usability of XY charts in real-world datasets where category names are often long ( product names, descriptions, logs).