addShape

Adds a new shape to the diagram.

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
Not finding the help you need? Improve this article