Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xychart X-axis labels overlapping each other to be unreadable - need feature to rotate them by 45 degrees (GNUplot can do this) #5926

Open
HariSekhon opened this issue Oct 4, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@HariSekhon
Copy link

HariSekhon commented Oct 4, 2024

Description

xychart X-axis labels overlap with each other

Need a way to rotate them by 45 degrees to fit them better like GNUplot can do.

Steps to reproduce

Code is here:

https://raw.githubusercontent.com/HariSekhon/Diagrams-as-Code/refs/heads/master/git_commits_per_month.mmd

Compare the same graph and data generated in GNUplot vs MermaidJS xychart with both charts one above the other here:

https://github.com/HariSekhon/Diagrams-as-Code/?tab=readme-ov-file#git-commits-per-month-for-this-repo

Screenshots

Code Sample

Code is here:

https://raw.githubusercontent.com/HariSekhon/Diagrams-as-Code/refs/heads/master/git_commits_per_month.mmd

Setup

  • Mermaid CLI version: 11.2.0
  • Browser and Version: Chrome

Suggested Solutions

Add ability to rotate X-axis labels like GNUplot can do so the X-axis labels look more like this:

Additional Context

I got this idea from GNUplot, the code for the comparable graph is here:

https://github.com/HariSekhon/Diagrams-as-Code/blob/master/git_commits_per_month.gnuplot

and the setting in GNUplot to do this if you want to reference its docs is:

set xtics rotate by -45
@HariSekhon HariSekhon added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant