position

Get or sets the element position.

Parameters

offset kendo.dataviz.diagram.Point

The origin of the element.

Example

<div id="diagram"></div>
<script>
$("#diagram").kendoDiagram({
    shapes: [{
        id: "rect1",
        type: "rectangle",
        x: 50,
        y: 50,
        height: 100,
        width: 150
    }]
});

var diagram = $("#diagram").getKendoDiagram();
var shape = diagram.getShapeById("rect1");
var rect = diagram.shapes[0];

// Get current position
var currentPosition = rect.position();
console.log("Current position:", currentPosition);

// Set new position
var newPoint = new kendo.dataviz.diagram.Point(100, 100);
rect.position(newPoint);
console.log("New position set to:", rect.position());
</script>
In this article
position
Not finding the help you need?
Contact Support