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.


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>
  var Shape = kendo.dataviz.diagram.Shape;
  var diagram = $("#diagram").data("kendoDiagram");

  var shape = new Shape({x: 500, y: 100, fill: "red"});

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

In this article