Configuring a Gantt Chart

Create two tables that store Task and Resources information, configure two data sources to store the table data, and use a special interface to configure the Gantt control in your model.

Implementation:

  1. Create the table structure for the control to store Task data for the Gantt chart . Add the following properties: TaskId, TaskName, StartDate, Resources, Progress, Predecessors, ParentId, EndDate, Duration. For more information refer to Designing Your Own Data.
  2. Make sure the table properties are assigned the correct Types:

Task table property types.

There must be no data in the table when the properties have been added.

  1. Create a second table to store Resources data. Add the following properties: ResourceId and ResourceName, and assign the following property types to them:

Resource table property types.

This table holds information on the resources required to complete task. For instance, you could create a list of names in the Resource Name table column, so that when you add a task later you can assign resource to it.

  1. Create two data sources corresponding with both tables fields to store tasks and resource information you will be adding to the Gantt chart later.
  2. Add aliases to each table's data source fields.
  3. Create two actions - use the WriteData function to add a new row of task data or update an existing one.

Creating actions will allow data to be passed between KnowledgeKube and your data source. When a new or existing task is added to the Gantt chart the information will be stored after you close it. When you re-open it, tasks you have previously added and updated in an earlier session will be retained.

  1. Add another action using the DeleteData function for deleting tasks.
  2. Switch to the Definition tab.
  3. Add the Gantt question type to your question group.
  4. Double-click the question to open the Properties tab.
  5. Click the Configure button to open the Gantt Definition dialog.
  6. Use the Task DataSource and Resource DataSource drop-down menus to select the two data sources you created earlier to store task based information, and resources available for the associated task.
  7. Use the check boxes next to each day of the week to customise the days you want to include in the working week.
  8. Use the First Day of the Week drop-down menu to nominate what day you want the chart's week to start.
  9. (Optional) Tick the Highlight Weekends check box if you want to apply highlighting to the chart.
  10. Enter the action names you created earlier into the respective Insert, Update and Delete Action drop-down menus.
  11. Switch to the Data Binding panel.
  12. To store task and resources data, map the fields of the two data sources you created earlier to the corresponding chart fields in this window.
  13. Switch to the Time and Date panel.
  14. Use the options in this window to customise your chart's default view, date format, dates which tasks will be stored between, and other settings.
  15. (Optional) Switch to the Web panel and configure additional settings specific for when you view the chart via the web.
  16. Click Save to store the chart's configuration settings. These changes will take effect when you view the Gantt chart in your chosen web browser.
  17. Access the Gantt chart through the front end to create a new task.