Gantt Tip: Selective Visualization of Links in a Gantt Chart

Posted by André Pick on Nov 27, 2014 8:33:00 AM

We very often develop a Gantt scheduling application for manufacturing companies. In these cases, our customers want to schedule orders (and their operations) and manage the machine utilizations by using Gantt charts. A machine utilization Gantt chart illustrates which operations are worked off at which machines at which time. In case that an order consists of many operations, links are used to let the planner better understand the depdencies. Typically, these links can, however, only be switched on or off for the complete view and all orders. If a company processes many orders simultaneously, displaying these links can result in a “visual chaos”. This blog post shows how  - by using a trick -  you can display only links of selected orders when working with our .NET Gantt chart control VARCHART XGantt.

An order is subdivided into operations at a machine

An order in a manufacturing company usually consists of different operations. In metal processing, for example, the sheet metal for an ordered product has to be punched out first, then the several parts have to be welded together and afterwards the whole product has to be coated. The below Gantt chart represents the typical "machine view" of a scheduling application, and provides an immediate understanding of the respective machines' loads. However, it does not give you an understanding of the dependencies between the operations.

Selective_I

Too many links result in visual chaos

A standard technique to keep track of dependencies is to use links. However, if the option only is "show links" or "do not show links" and if the Gantt shows many orders with a lot of operations, the visualization of these links can be quite challenging for the planner.

Selective_II

Selected links provide clarity

The solution of this link overload lies in the selection of links. Only the selected order is to be focussed on and provided with links. Thus the planner can precisely track the order he is just controlling or wanting to change via drag & drop.

Selective_III

How to select single links in VARCHART XGantt

So, this was the "theory". Let's get hands-on and look how to achieve this with our .NET Gantt control VARCHART XGantt. Hence, we ask you to first download the file VcLinkVisibilityHandler.cs and use this class in your .NET project. From now on, all links will be hidden, except when an operation is clicked. As soon as that happens, the complete chain of dependency will be shown.

  • At design time:
    First, you have to add a further string data field to the link data table. This field will later be used to control the visibility of the single links.
  • At runtime:
    Integrate the file VcLinkVisibilityHandler.cs in an existing .NET project. The class is in the namespace NETRONIC.XGanttExtensions.Links. It is static and therefore doesn’t have to be instanced.
    There are three public methods:
    Initialize (...)  Update(...) HideVisibleLinks(...)

  • In the Form_Load event call the method VcLinkVisibilityHandler.Initialize(...).
    1st parameter: XGantt
    2nd parameter: table field index of the predecessor
    3rd parameter: table field index of the successor
    4th parameter: table field index of the newly created visibility flag
    5th parameter: table field name of the newly created visibility flag
    6th parameter: name of the LinkAppearance to be used

    Code sample:
    private void Form1_Load(object sender, EventArgs e) 

    VcLinkVisibilityHandler.Initialize(vcGantt1, 1, 2, 5, "VisibleField", "Standard");  //Load data... 
    }
  • Now you only have to show or hide the links if necessary. This is done by the VcNodesMarking event of XGantt.

    Example code:
    private void vcGantt1_VcNodesMarking(object sender, VcNodesMarkingEventArgs e)
      {
     
    VcLinkVisibilityHandler.Update(e.NodeCollection);
      }
     

This class works now.

Tips:

  • To show all links you can run the following code:
    VcLinkVisibilityHandler.Update(vcGantt1.NodeCollection);

  • If you reload data in your application you have to reset the class first:
    VcLinkVisibilityHandler.HideVisibleLinks();

Would you agree that this blog post was the solution to one of the challenges you face every day since production scheduling is one of your main responsibilities in your company? Then have a look at this post dealing with another key issue of production scheduling: How to visualize resource bottlenecks in a Gantt chart

Not yet using VARCHART XGantt? Get started with your trial today:

VARCHART XGantt free trial - Gantt chart control .NET

Topics: Windows Forms Gantt Control, XGantt development tricks, Gantt Best Practice, Gantt Chart Controls