redrawVisual

Redraws the shape visual element and its content

Example - redrawing the shape visual element

<div id="diagram"></div>
<script>
  var shapesDataSource = {
    data: [
      { id: 1, JobTitle: "Job 1", Color: "red" },
      { id: 2, JobTitle: "Job 2", Color: "blue" },
      { id: 3, JobTitle: "Job 3", Color: "green" }
    ]
  };

  var connectionsDataSource = {
    data: [
      { id: 1, from: 1, to: 2},
      { id: 2, from: 1, to: 3},
    ]
  };

  var diagram = $("#diagram").kendoDiagram({
    dataSource: shapesDataSource,
    connectionsDataSource: connectionsDataSource,
    layout: {
      type: "tree"
    },
    shapeDefaults: {
      content: {
        template: "#= dataItem.JobTitle #"
      }
    }
  }).getKendoDiagram();

  diagram.shapes[0].options.content.template = "Root";
  diagram.shapes[0].redrawVisual();
</script>
In this article