We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
My axis dimensions have long names, Is there a way to make them appear on 2 lines nicely ?
The text was updated successfully, but these errors were encountered:
My approach was creating a function which returns a text on 2 lines and than replace the html of the title. (something like:
const getSplittedString = (word, wordsPerLine) => { const split = word.split(" "); let i = 1; let html = `<tspan x="0" dy="1.2em">${split[ 0 ]}`; if (!wordsPerLine) wordsPerLine = Math.ceil(split.length / 2); split.slice(1).map((s, index) => { i++; html = html + ( index === split.length - 2 ? ` ${s}</tspan>` : (i % wordsPerLine == 0 ? ` ${s}</tspan><tspan x="0" dy="1.2em">` : ` ${s}`)) }) return html; }
) I am calling this function for each title element and than replace the html, also update the transform property.
Is kind of a weird approach but it does the job.
Sorry, something went wrong.
No branches or pull requests
My axis dimensions have long names,
Is there a way to make them appear on 2 lines nicely ?
The text was updated successfully, but these errors were encountered: