grapher: fix overlap of Y axis label/numbers

[#47779771]

Sometimes in initial rendering of the graph the Y axis
label would overlap the numeric labels.

Fix longestNumber function.