addShape

Adds a new shape to the diagram. If the diagram is bound to a data source, do not use addShae(newShape). Instead, use diagram.dataSource.add(newShape); and optionally .sync() the data source.

Parameters

obj Object

A Shape instance or a Point where the default shape type will be added.

undoable Boolean (default:true)

Whether the addition should be recorded in the undo-redo stack.

Example - adding a shape to the diagram

<div id="diagram"></div>
<script>
  var Shape = kendo.dataviz.diagram.Shape;
  $("#diagram").kendoDiagram();
  var diagram = $("#diagram").data("kendoDiagram");

  var shape = new Shape({x: 500, y: 100, fill: "red"});
  diagram.addShape(shape);
</script>

Returnskendo.dataviz.diagram.Shape The newly created diagram shape.

In this article