Hello Telerik
First check this example : https://dojo.telerik.com/oraZInUQ
Q1. When constructing a diagram like this, if the length of the textblock text becomes larger than the length of the rectangle, is there a way to control this? I wish there was a line break.
Q2. The length of the text is longer, so the selection area for the shape has increased. I want the selection area to be based on the width and height of the rectangle. Is it possible to adjust the selection area of shape?
Thank you for your reply.
Hello,
I'm creating a diagram. I've done some research on how to create a custom shape, but I'm having a few problems on dynamically modifying the data of the various elements present in the shape.
1) Firstly, I've understood the code bellow that allows me to create a custom shape:
let newShape = function() {
let dataviz = kendo.dataviz
let g = new dataviz.diagram.Group()
let dataItem = options.dataItem
g.append(new dataviz.diagram.Rectangle({
width: 210,
height: 75,
stroke: {
width: 0
},
fill: {
gradient: {
type: 'linear',
stops: [{
color: dataItem.colorScheme,
offset: 0,
opacity: 0.5
}, {
color: dataItem.colorScheme,
offset: 1,
opacity: 1
}]
}
}
}))
g.append(new dataviz.diagram.TextBlock({
text: dataItem.name,
x: 20,
y: 20,
fill: '#fff'
}))
g.append(new dataviz.diagram.TextBlock({
text: dataItem.props,
x: 20,
y: 40,
fill: '#fff'
}))
return g
}
However, I'm having trouble dynamically modifying the value of a TextBlock.
Which field do I need to access, after retrieving the shape via diagram.shapes[i] , to be able to modify the "text" field of a TextBlock? Or, more generally, how can I easily retrieve an element (TextBlock, etc.) from a compound shape?
I've tried accessing various fields in the shape object referring to the TextBlock element and then calling shape[i].redraw( ) / .redrawVIsual( ), but no shape is updated.
2) Secondly, what kind of components can be added to the Group ? My goal is to add a progress bar into my shape, but I don't think that's possible. Is there a list of elements (TextBlocks, ...) that can be appended to Group ? Or any idea to have a progress bar in a shape ? Maybe using the progressbar component and attach a progress bar to each shape ?
Thanks in advance,
Best,
VB
I need to add a button inside a diagram element as example inside a shape or group elements, if it is not possible, add a pop up menu or something similar...
Do you have any advice?
My requirement is to create a diagram which is using different widgets to child and parent nodes. Is there a way to use two or more different custom templates for parent and its child nodes. Please see the image below that is something I want to create
Hello,
I'm trying to combine custom positions of shape connectors with the save and load functionality. I've combined the following two examples in the dojo:
https://docs.telerik.com/kendo-ui/api/javascript/dataviz/ui/diagram/methods/load
Dojo example: https://dojo.telerik.com/oqAloqOY/2
As you can see after loading the saved model the custom connectors are gone. Is there any way to persist them or at least re-apply them after load?
Thanks
Hello,
We have a diagram with layered layout, aligned to right. The diagram can have one or more root nodes.
The problem is that when we have multiple roots, we want to align them one under another, instead, if they are not very long, they are aligned to the right of each other.
Is there a way to achieve this alignment? We searched documentation but didn't find any specific property.
I attach images of how the diagram looks now and how we need it to look.
Thanks,
Iuliana