I am trying to do a multi-leveled diagram using a layout of layered type and radial subtype with my items coming from a datasource and my template based of the one in the demo example. The chart itself does display and the items are connected properly as to their relation but using straight connectors under 90° angle separation (0, 90, 180, 270) and not how I expected from what I've seen in the picture within the API documentation.
Is there something else I have to do to achieve this kind of connectors instead of the classic rigid structure?
Including my code for better reference on what I have so far:
function visualTemplate(options) {
var dataviz = kendo.dataviz;
var g = new dataviz.diagram.Group();
var dataItem = options.dataItem;
var bgcolor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16);
g.append(new dataviz.diagram.Rectangle({
width: 100,
height: 100,
stroke: {
width: 0,
color: "black"
},
background: bgcolor
}));
g.append(new dataviz.diagram.TextBlock({
text: dataItem.name,
x: 10,
y: 25,
color: "white"
}));
g.append(new dataviz.diagram.TextBlock({
x: 10,
y: 45,
text: dataItem.ref_no,
color: "white"
}));
g.append(new dataviz.diagram.TextBlock({
x: 10,
y: 65,
width: 100,
text: dataItem.level,
color: "white"
}));
return g;
}
function createDiagram() {
$("#diagram").kendoDiagram({
dataSource: new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "ashx/hierarchicalDiagram.ashx",
dataType: "jsonp"
}
},
schema: {
model: {
children: "items"
}
}
}),
layout: {
type: "layered",
subtype: "radial",
startRadialAngle: 0,
endRadialAngle: 60,
iterations: 500,
nodeDistanc: 80,
grid: {
width: 900,
height: 800,
componentsGridWidth: 900,
offsetX: 0,
offsetY: 0
}
},
shapeDefaults: {
visual: visualTemplate,
editable: false,
rotatable: false,
resizable: false
},
shapes: {
content: {
align: "center"
},
rotation: {
angle: 15
}
},
connectionDefaults: {
hover: {
stroke: {
color: "red"
}
},
stroke: {
color: "black"
}
}
});
var diagram = $("#diagram").getKendoDiagram();
diagram.bringIntoView(diagram.shapes, {align: "center"});
}
$(document).ready(createDiagram);
Is there something else I have to do to achieve this kind of connectors instead of the classic rigid structure?
Including my code for better reference on what I have so far:
function visualTemplate(options) {
var dataviz = kendo.dataviz;
var g = new dataviz.diagram.Group();
var dataItem = options.dataItem;
var bgcolor = '#' + (Math.random() * 0xFFFFFF << 0).toString(16);
g.append(new dataviz.diagram.Rectangle({
width: 100,
height: 100,
stroke: {
width: 0,
color: "black"
},
background: bgcolor
}));
g.append(new dataviz.diagram.TextBlock({
text: dataItem.name,
x: 10,
y: 25,
color: "white"
}));
g.append(new dataviz.diagram.TextBlock({
x: 10,
y: 45,
text: dataItem.ref_no,
color: "white"
}));
g.append(new dataviz.diagram.TextBlock({
x: 10,
y: 65,
width: 100,
text: dataItem.level,
color: "white"
}));
return g;
}
function createDiagram() {
$("#diagram").kendoDiagram({
dataSource: new kendo.data.HierarchicalDataSource({
transport: {
read: {
url: "ashx/hierarchicalDiagram.ashx",
dataType: "jsonp"
}
},
schema: {
model: {
children: "items"
}
}
}),
layout: {
type: "layered",
subtype: "radial",
startRadialAngle: 0,
endRadialAngle: 60,
iterations: 500,
nodeDistanc: 80,
grid: {
width: 900,
height: 800,
componentsGridWidth: 900,
offsetX: 0,
offsetY: 0
}
},
shapeDefaults: {
visual: visualTemplate,
editable: false,
rotatable: false,
resizable: false
},
shapes: {
content: {
align: "center"
},
rotation: {
angle: 15
}
},
connectionDefaults: {
hover: {
stroke: {
color: "red"
}
},
stroke: {
color: "black"
}
}
});
var diagram = $("#diagram").getKendoDiagram();
diagram.bringIntoView(diagram.shapes, {align: "center"});
}
$(document).ready(createDiagram);