This request is about Break x axis of answer buttons table into two rows by GithubAnon0000 · Pull Request #3952 · ankitects/anki · GitHub.
Goal
The goal is to split the text (e.g. “Learning”) and the percentage into to separate rows. I managed to do that but there are two problems:
- The percentage text is misaligned. It should be centered instead.
- The percentage text is cut off, but shouldn’t be.
Possible causes
#1
I assumed the problem with #1 is how I align the percentage. I did that with
tspan2.setAttribute("dx", "-4em"); // i realized it works. It's probably a coincidence and a hack
But I’m not sure what do use instead of this, so that the alignment is perfectly centered. It also must work with localization, which might have much longer or shorter strings.
#2
Here I assumed the problem is me using a setTimeout() function. I couldn’t figure out how to do the same without a timeout though, because the text (“Learning”, …) is only available after a timeout. I also apparently cannot feed linebreaks or html into the .tickFormat()
function of line 136.
Help and advice is much appreciated!