You can add Gantt charts in the Visualization view to better display, for example, planning and scheduling solutions.
Gantt charts are automatically created to display the solution for scheduling problems created with the Modeling Assistant. You can, however, edit, create and configure Gantt charts for any data where it is meaningful, using the Gantt widget. You can use the Widget Editor to select the relevant scenario, and Resources, Activities, Reservations and Dates to be displayed. You can also use the JSON editor to configure Gantt charts, by clicking the pencil icon and selecting the JSON pane.
data
field value $cognitive-gantt
here dynamically enables the
Gantt widget to connect to the Modeling Assistant
solution. This dynamic loading can also imply that it might take a moment for the Gantt chart to
appear. { "name": "", "type": "Gantt", "props": { "container": "", "data": "$cognitive-gantt", "spec": {}, "search": "" } }
resources
, activities
and
reservations
data, as follows:"data": [ "resourcesTableName", "activitiesTableName", "reservationsTableName" ],
spec
section to define these tables, as follows. The
parent
fields are optional but all other fields are
mandatory."resources": { "data": "resourcesTableName", "id": "id", "parent": "parent", "name": "name" }, "activities": { "data": "activitiesTableName", "id": "id", "name": "name", "start": "start", "end": "end", "parent": "parent" }, "reservations": { "data": "reservationsTableName", "activity": "activity", "resource": "resource" },
Another mandatory field that you must also define in the specification is the
dateFormat so that all the common date formats can get converted into real
dates. Some common date formats are for example '
', 'yyyy-MM-dd
', and so on. You can also use yyyy-MM-dd
HH:mm:ss
for milliseconds for Epoch time,
for example, S
. The "dateFormat": "S"
must match the
dateFormat
and "start"
fields of the "end"
table."activity"
The error message No time window defined is displayed until you define the
table, with activity
and start
fields that
use the specified end
.dateFormat
-
resourceQuantity where you can configure the quantity column in the resources table to enable the Gantt chart to get the necessary information to populate a Load Resource Chart for you. You can set this column as follows:
"resourceQuantity": "quantity"
- You can also set the type of Gantt chart that you need:
orActivityChart
. You can set the type as follows:ScheduleChart
. You can also omit this setting and the default is"type": "ActivityChart",
. If you choose to have anScheduleChart
, you must provide more information about the constraints table name and the mapping for this table:ActivityChart
"constraints": { "data": "constraintsTableName", "from": "from", "to": "to", "type": "type" },
The
andfrom
values are the column names in your constraints table that define the order of precedence of tasks. The type values here correspond to the Gantt-chart library values 0 to 3:to
For example, if yourSTART_TO_START: 0, START_TO_END: 2, END_TO_END: 3, END_TO_START: 1,
task starts after the end of yourto
task, select 1 as the type value.from
ScheduleChart
example { "name": "", "type": "Gantt", "props": { "container": "", "data": [ "resources", "activities", "reservations" ], "spec": { "resources": { "data": "resources", "id": "id", "parent": "parent", "name": "name" }, "activities": { "data": "activities", "id": "id", "name": "name", "start": "start", "end": "end", "parent": "parent" }, "reservations": { "data": "reservations", "activity": "activity", "resource": "resource" }, "dateFormat": "S", "resourceQuantity": "quantity" }, "search": "" } }
ActivityChart
example{ "name": "", "type": "Gantt", "props": { "container": "", "data": [ "resources", "activities", "reservations", "constraints" ], "spec": { "type": "ActivityChart", "resources": { "data": "resources", "id": "id", "parent": "parent", "name": "name" }, "activities": { "data": "activities", "id": "id", "name": "name", "start": "start", "end": "end", "parent": "parent" }, "constraints": { "data": "constraints", "from": "from", "to": "to", "type": "type" }, "reservations": { "data": "reservations", "activity": "activity", "resource": "resource" }, "dateFormat": "S", "resourceQuantity": "quantity" }, "search": "" } }