Replies: 1 comment
-
You need to use the break text utility directly. const text = 'My very long text';
const textAttributes = { 'font-size': 15, 'font-family': 'sans-serif' };
const wrappedText = util.breakText(text, { width: 20, ellipsis: true }, textAttributes);
const vLabel = V('text').attr({ x: 10, y: y, ...textAttributes }).text(wrappedText, { textVerticalAnchor: 'top' }); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am trying to create a custom ElementView where I will display an array of strings, one line per item. These strings should be truncated to the width of an element body and ended by '...'. However I did not yet figured out how to do this truncation. I tried this but it didn't work:
How can I set the maximal length of a text inside
V('text')
so that length will adopt to the element size?Beta Was this translation helpful? Give feedback.
All reactions