Truncate labels, which does not fit in box.

Close #1208.
since tickLabels.text can take in a function, we can put this logic within the text callback