19. July 2021

Custom Gantt Colors

The INOSIM Gantt chart provides the option to color allocation bars on the basis of various predefined attributes. In the order view, it is possible to link the color scheme to unit procedures as well as to order attributes, such as the unit procedures´ batch number, the orders’ name or permanent custom attributes linked to one of the objects. The operation view also provides coloring according to unit operation properties. Coloring the bars with respect to the focus of your analyzation can significantly enhance the overview in the INOSIM Gantt chart.

Since INOSIM version 12, the Gantt chart enables users to customize the color scheme in two additional ways:

  1. By using permanent custom attributes of the type Color, the user can precisely define the color of allocation bars.
  2. In the color setting Type (Unit Operation), the user can individually customize the color scheme of operation and waiting time types with the OperationColorOverride and the WaitColorOverride property of the Gantt object. This only works in operation view.

Colors with Custom Attributes

To color allocation bars on the basis of a permanent custom attribute, at first you need to create a custom attribute via the Project menu in the INOSIM menu bar. Create a new custom attribute for either the object category Production Orders, Unit Procedures (Production Orders) or Unit Operations (Production Orders). Make sure that you create a permanent custom attribute and choose the data type Color.

Creation of a new Custom Attribute of the type Color.

You will now be able to select your custom attribute as basis for the allocation bar coloring in the Gantt chart’s Color setting.

Selection of a Custom Attribute for the color of allocation bars in INOSIM Gantt.

To define the colors the bars should get in the chart, you can use the corresponding property input in INOSIM (only works for Custom Attributes of the category Production Orders, see Order List) or define values dynamically via Visual Basic (works for all Custom Attribute categories). When defining colors directly in INOSIM, please use Hex color codes, such as #95ff00 for a bright-green color. To assign colors via Visual Basic, use the RGB function: RGB(149,255,0) for the same bright green.

Coloring the Order Batch 1 in bright green directly in INOSIM Order list

Orders("Batch 1").CustomAttributes("My Custom Attribute") = RGB(149,255,0)

A detailed example on how to use the coloring on basis of a custom attribute of the type color is given in section Example Project: Custom Gantt Colors below.

OperationColorOverride property and WaitColorOverride property

In the Gantt chart’s operational view, a common scheme is the coloring on basis of the operation types (process, setup, transfer, …). For this color scheme, INOSIM provides the option to change the colors for each operation type as well as for the waiting time types (waiting for transfer, waiting for resource…). To do so, the OperationColorOverride and the WaitColorOverride property of the Gantt object in Visual Basic need to be addressed. Call the properties, for example in the initialization or the end event of your simulation, address the operation or waiting time, and then set the property with help of the RGB function.

In the code example given below, the color of all transfer operations is changed to a dark green and, thus, made easily distinguishable from, e.g., simple transfer operations, which will still be colored in blue. Furthermore, the coloring of waiting times for synchronization are colored in the same red color than waiting times for transfers.

Private Sub Simulation_EndSim()
    'Set Color of transfer operation type to a dfferent color
    Gantt.OperationColorOverride(opTransfer) = RGB(47,201,106)
    'Set Color of waiting type synchronization to the same color as waiting ‘type transfer
    Gantt.WaitColorOverride(wSynchronization) = RGB(255,106,106)
End Sub

Gantt chart in operational view colored on basis of operation type with manipulated colors for transfer operations (changed from blue to green) and waiting times for synchronization (changed from yellow to red)

 

The default colors of the different operation and waiting time types can be found in the INOSIM documentation sections for the OperationColorOverride and the WaitColorOverride property in chapter Basic: Object Model. A list of operation types and waiting types can be found in chapter Basic: Object Model under Constants and in sections OperationType and WaitType, respectively.

Example Project: Custom Gantt Colors

After login, you can download the example project. In that model, two different custom attributes of type color are used to show useful details in the Gantt chart. At first, the custom attribute Targeted Startdate is declared for the category Production Orders. In the example model, twelve orders (one for each production batch) are scheduled without a scheduled start date. Thus, the simulation tries to run the orders as fast as possible. The custom attribute is used to show the targeted day on which each order should start. The first four orders should start on day one and are colored in blue (#3366CC), Orders 5 to 8 should start on day two and are colored in green (#99CC33), Orders 9 to 12 should start on day three and are colored in brown (#CC9933). The color input is given in the order list using the Hex code.

Order list with Custom Attribute “Targeted Startdate”.

If the color scheme in the Gantt chart is set to Targeted Startdate, the user can easily identify if the targeted dates to start the batch can be kept.

Gantt-Chart, colored based on the Custom Attribute “Targeted Startdate“.

Another helpful example is the coloring of bars with respect to the real allocation duration of a unit by each order. In this example, a traffic light system is used to show which orders did allocate a unit within certain duration limits. In a first step, the custom attribute Allocation Duration of the type color is declared for the category Unit Procedures (Production Orders). In an operation end control of the last operation, in each unit procedure the allocation duration by the procedure is calculated:

(Simulation.SimDate - cop.OrderProcedure.StartDate)/3600

For the unit procedure Reaction, the color is set to green if the allocation duration is lower than 5.5 hours, to yellow if the allocation duration is between 5.5 and 8 hours, and to red if the allocation duration is higher than 8 hours:

'Set Color CA of OrderProcedure on basis of allocation duration for 
If Allocation_dur < 5.5 Then
    'Below 5 hours -> Color in green
    cop.OrderProcedure.CustomAttributes("Allocation Duration") = RGB(50,205,50)
ElseIf Allocation_dur < 8 Then
    'Between 5.5 and 8 hours -> Color in yellow
    cop.OrderProcedure.CustomAttributes("Allocation Duration") = RGB(255,183,5)
Else
    'More than 8 hours -> Color in Red
    cop.OrderProcedure.CustomAttributes("Allocation Duration") = RGB(214,6,5)
End If

The resulting Gantt chart directly reveals critically long allocation bars.

Gantt-Chart, colored based on the Custom Attribute “Allocation Duration“.

The example projects also include the example given in section OperationColorOverride and WaitColorOverride property to change colors of the operation type Transfer and the waiting time type Synchronization. Another creative example for using the OperationColorOverride and WaitColorOverride property is to color the Gantt chart in the colors of your company.

Download

  • Example project
  • PDF printout of this Tip & Trick

More Questions?

Want to know more about this topic or have another question? Please contact us!

Array ( [posts_per_page] => 3 [post_type] => [category__in] => Array ( [0] => 36 ) [orderby] => rand [order] => ASC )

More Tips & Tricks

This Tip & Trick is about using a VBA Timer execution timer for VBA controls and measuring the execution duration of VBA controls. To check…

Benefit from your Excel VBA Know-how In this tip and trick we want to show you how to activate and use Excel’s VBA commands from…

4. October 2019

Applying Table Objects

Table objects in INOSIM are indexed tables. By the row or column headline, you can directly access a cell’s content without having to search for…

more

Direct Contact

During local business hours

Germany +49 231 97 00 250

USA +1 214 663 3101

India +91 9766 331 092