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

Pie Chart Title gets cut off if too long #6232

Open
youngcitrus opened this issue Jan 28, 2025 · 0 comments
Open

Pie Chart Title gets cut off if too long #6232

youngcitrus opened this issue Jan 28, 2025 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@youngcitrus
Copy link

youngcitrus commented Jan 28, 2025

Description

When the title of the pie chart is too long, the title is cropped.
Our use case involves some Generative AI to create the title and data that feeds to the charts and in some cases the titles can be lengthy.

It appears that SVG elements don't support text-wrapping or line breaks, but it would be awesome if Mermaid could handle splitting longer titles into multiple elements and adding them to the svg. For now one workaround is using CSS to make the font-size smaller, but that doesn't guarantee no title crop in the case of even lengthier titles.

Could you please provide a fix or alternative solution for this?

Steps to reproduce

Create a pie chart
Give it a long title.

Sample mermaid code in live editor:
pie title Types of industry trends in the last 12 months

Result:
Pie chart title is cropped

Expected:
Title is not cropped

Screenshots

Image

Code Sample

pie title Types of industry trends in the last 12 months

Setup

  • Mermaid version: 11
  • Browser and Version: [Chrome, Edge, Firefox] Chrome: 131.0.6778.265 (Official Build) (arm64)

Suggested Solutions

No response

Additional Context

No response

@youngcitrus youngcitrus added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Jan 28, 2025
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