ZingChart: How do you wrap label, legend, etc. text?
Text overflow can easily be controlled for all text objects in the ZingChart library.
The most direct way is to first set a max-width
for the object in which you want to wrap the text. Next set, wrapText
to a value of true
maxWidth: 40, wrapText: true
However, there are other possibilities as well. In the demo below we have use 3 different methods to address text length.
-
Set the object width and the
wrapText
attribute -
Simply place a
<br>
tag within the text string to force a break -
Limit the number of characters which will be displayed using the
maxChars
attribute. (See the scale labels)