clear

Removes all elements from the group.

Example

<div id="diagram"></div>
<script>
var shape1 = new kendo.dataviz.diagram.Rectangle({
    x: 50,
    y: 50,
    width: 100,
    height: 50,
    fill: {
        color: "#6EB5FF"
    }
});

var shape2 = new kendo.dataviz.diagram.Rectangle({
    x: 200,
    y: 50,
    width: 100,
    height: 50,
    fill: {
        color: "#FFB74E"
    }
});

var group = new kendo.dataviz.diagram.Group();
group.append(shape1);
group.append(shape2);

var drawingElement = group.drawingElement;
console.log("Drawing element type:", drawingElement.nodeType);
console.log("Drawing element children:", drawingElement.children.length);

group.clear();

console.log("After clear group children are:", group.children.length);
</script>
In this article
clear
Not finding the help you need?
Contact Support