You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"unit": "tons of CO₂ per passenger km per active planes",
@jdhoffa suggested that rather than increasing the height of the plot, that I break the text into two lines so that it fits. In principal, that seems to be the safest thing to do, especially since the text comes from the data, so the plot ideally should be able to recognize that whatever text it is told to put there, it should automatically break it into multiple lines if it's not going to fit.
Doing that though, is more complicated than it may seem... the plot code would need to estimate the space needed, if the text is too big then it would need to parse the text and find the appropriate place to split it (e.g. at the closest space, or breaking a long word with a hyphen), then add a newline/s where appropriate and adjust the baseline so the new lines do not overlap the plot.
An easier solution would be to modify the data in the text beforehand by adding a newline when/where appropriate in workflow.pacta.dashboard, though the plot might still have to adjust the baseline appropriately, e.g. if it detects one or more newline characters in the text.
The easiest solution would be to just bump the plot height a bit, especially seeing that only the last character is partially cut off, so we likely only need a few extra pixels.
Indeed, splitting the next is non-trivial and adding a new line in the text does not work for text within svgs. We would need to append two separate lines of text to svg instead of one in case the text is too long and find some sensible way of telling where the text should be split. I think that insteasing the height of the plot is currently the best solution, especially because the units are hard-coded so we know exactly how long the longest label will be.
Currently for aviation:
Increase plot height to fit the text.
AB#12272
The text was updated successfully, but these errors were encountered: