Search results

Overview Control in ASP.NET MVC Diagram control

26 Nov 2021 / 2 minutes to read

Overview control allows you to see a preview or an overall view of the entire content of a diagram. This helps you to look at the overall picture of a large diagram and also to navigate, pan, or zoom, on a particular position of the page.

When you work on a very large diagram, you may not know the part you are actually working on, or navigation from one part to another might be difficult. One solution for navigation is to zoom out the entire diagram and find where you are. Then, you can zoom in a particular area you want to. This solution is not suitable when you need some frequent navigation.

Overview control solves these problems by showing a preview, that is, an overall view of the entire diagram. A rectangle indicates viewport of the diagram. Navigation becomes easy by dragging this rectangle.

Create overview

The sourceID property of overview should be set with the corresponding diagram ID for the overall view.

The width and height properties of the overview allow you to define the size of the overview.

The following code illustrates how to create overview.

Zoom and Pan

In overview, the view port of the diagram is highlighted with a red colored rectangle. Diagram can be zoomed/panned by interacting with that. You can interact with overview as follows:

  • Resize the rectangle: Zooms in/out the diagram.
  • Drag the rectangle: Pans the diagram.
  • Click at a position: Navigates to the clicked region.
  • Choose a particular region by clicking and dragging: Navigates to the specified region.

The following image shows how the diagram is zoomed/panned with overview.

Copied to clipboard
<div class="col-lg-12 control-section">
    <div class="content-wrapper">
        @Html.EJS().Diagram("diagram").Width("100%").Height("590px").GetNodeDefaults("getNodeDefaults").GetConnectorDefaults("getConnectorDefaults").ScrollSettings(s => s.ScrollLimit(Syncfusion.EJ2.Diagrams.ScrollLimit.Infinity)).DataSourceSettings(ss => ss.Id("Id").ParentId("ReportingPerson")
        .DataManager(new DataManager() { Data = (List<OverviewData>)ViewBag.Nodes })).Layout(l => l.Type(Syncfusion.EJ2.Diagrams.LayoutType.OrganizationalChart).GetLayoutInfo("getLayoutInfo")).SnapSettings(se => se.Constraints(Syncfusion.EJ2.Diagrams.SnapConstraints.None)).SetNodeTemplate("setNodeTemplate").Mode(Syncfusion.EJ2.Diagrams.RenderingMode.SVG).Created("diagramCreated").Render()
<div class="col-lg-4 property-section" style="padding:0px;right:49px;bottom:38px;border: #eeeeee;border-style: solid;box-shadow: 0px 2px 2px rgba(0,0,0,0.3); background:#f7f7f7;position:absolute">
Copied to clipboard
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Syncfusion.EJ2.Diagrams;
using sample1.Models;

namespace sample1.Controllers
    public partial class DiagramController : Controller
        // GET: Overview
        public ActionResult Overview()
           ViewBag.Nodes = OverviewData.GetData();
            return View();

    public class OverviewData
        public string Id { get; set; }
        public string Name { get; set; }
        public string Designation { get; set; }
        public string ReportingPerson { get; set; }
        public string Image { get; set; }

        public OverviewData(string id, string name, string designation, string reportingperson)
            this.Id = id;
            this.Name =name;
            this.Designation =designation;
            this.ReportingPerson =reportingperson;

        public static List<OverviewData> GetData()
            List<OverviewData> data = new List<OverviewData>();
            data.Add(new OverviewData("parent", "Maria Anders", "Managing Director", ""));
            data.Add(new OverviewData("1", "Ana Trujillo", "Project Manager", "parent"));
            data.Add(new OverviewData("2", "Anto Moreno", "Project Manager", "parent"));
            data.Add(new OverviewData("3", "Thomas Hardy", "Project Lead", "1"));
            data.Add(new OverviewData("4", "Christina kaff", "Project Lead", "2"));
            data.Add(new OverviewData("5", "Hanna Moos", "Senior S/w Engg", "3"));
            data.Add(new OverviewData("6", "Peter Citeaux", "Senior S/w Engg", "4"));
            return data;