Hello,
I use the following code to format the text if it is too long.
function createShape(options) {
var shapeOptions = {
editable: false,
selectable: false,
id: options.id,
x: options.positionX || 0,
y: options.positionY || 0,
width: options.width || 200,
height: options.height || 50,
type: options.type,
path: options.path || undefined,
content: {
text: options.textData || undefined,
color: '#fff',
fontSize: 15
},
fill: options.fillColor || '#0088CC',
stroke: options.strokeColor || '#0088CC',
};
var shape = new kendo.dataviz.diagram.Shape(shapeOptions);
var texts = options.textData.split(" ");
for (var i = 0; i < texts.length; i++) {
shape.visual.append(new kendo.dataviz.diagram.TextBlock({
text: texts[i],
color: "#fff"
}));
}
shape.visual.reflow();
return shape;
}
I would like to be able to use the method : reflow() afterwards; so that the words of the text place this correctly. Can you tell me how to do that? Thank you for your help.