I am try to create a simple diagram, indicating the position of a record within a workflow. All I need is a line of different coloured circles, appropriately coloured, along with a label.
I have managed most of this, however the connectors, rather than linking to the circles, always use the text blocks to link to, meaning the lines are never straight, and not connected to the shapes.
How can I force the connectors to link to the shapes, and ignore the text?
I've attached a screenshot of the result I currently get.
Below is the page code:-
@{
ViewBag.Title =
"Index"
;
}
<h2>TEST</h2>
<script>
function
visualTemplate(options) {
var
dataviz = kendo.dataviz;
var
g =
new
dataviz.diagram.Group();
var
dataItem = options.dataItem;
g.append(
new
dataviz.diagram.Circle({
width: 50,
height: 50,
fill: dataItem.Colour,
stroke: {
width: 0
}
}));
g.append(
new
dataviz.diagram.TextBlock({
text: dataItem.PositionName,
x: 60,
y: 20,
color:
"black"
}));
return
g;
}
</script>
<div>
@(Html.Kendo().Diagram()
.Name(
"diagram"
)
.DataSource(dataSource => dataSource
.Read(read => read
.Action(
"GetWFData"
,
"Test"
)
)
.Model(m => m.Children(
"Items"
))
)
.Editable(
false
)
.Pannable(
false
)
.Zoom(0)
.Layout(l => l.Type(DiagramLayoutType.Layered))
.ShapeDefaults(sd => sd
.Visual(
"visualTemplate"
)
)
.ConnectionDefaults(cd => cd
.Stroke(s => s
.Color(
"#979797"
)
.Width(2)
)
)
)
</div>
Thanks