Our state of the art Gantt chart


Post by michal.sidlo »

Hi, how can I plot the events exactly according to the data in the database? My stages always move either to the beginning of the project or immediately after the previous stage. I need to have them as I have them in the data source, is it not possible for the stage to start a few days after the start of the project, or until a few days before the end of another stage?

{"project":{"calendar":"general","startDate":"2023-11-08T00:00:00"},"calendars":{"rows":[{"id":"general","name":"General","intervals":[{"recurrentStartDate":"on Sat at 0:00","recurrentEndDate":"on Mon at 0:00","isWorking":false}]}]},"tasks":{"rows":[{"id":"M225","name":"Stage 1","startDate":"2023-11-10T00:00:00","endDate":"2023-11-22T23:59:00","expanded":true,"percentDone":0,"effort":0.0,"url":"Default.aspx?newtab-form-189-id-225","index":1,"children":[{"id":"T13124","name":"Task 1.1","startDate":"2023-11-10T00:00:00","endDate":"2023-11-20T23:59:00","percentDone":0,"effort":168.0,"url":"Default.aspx?newtab-form-87-id-13124","index":1},{"id":"T13121","name":"Task 1.2","startDate":"2023-11-20T00:00:00","endDate":"2023-11-22T23:59:00","percentDone":0,"effort":0.0,"url":"Default.aspx?newtab-form-87-id-13121","index":2}]},{"id":"M226","name":"Stage 2","startDate":"2023-11-28T00:00:00","endDate":"2023-12-06T23:59:00","expanded":true,"percentDone":0,"effort":0.0,"url":"Default.aspx?newtab-form-189-id-226","index":2,"children":[{"id":"T13123","name":"Task 2.1","startDate":"2023-11-28T00:00:00","endDate":"2023-12-06T23:59:00","percentDone":0,"effort":168.0,"url":"Default.aspx?newtab-form-87-id-13123","index":1}]},{"id":"M227","name":"Stage 3","startDate":"2023-12-11T00:00:00","endDate":"2023-12-14T23:59:00","expanded":true,"percentDone":0,"effort":0.0,"url":"Default.aspx?newtab-form-189-id-227","index":3,"children":[]}]},"dependencies":{"rows":[{"id":"D35","fromEvent":"M225","toEvent":"M226","type":2,"lag":0}]},"resources":{"rows":[]},"assignments":{"rows":[]}}

Post by sergey.maltsev »

Hi!

Gantt has an ability to set timeline start.

Please check this property
https://bryntum.com/products/gantt/docs/api/Gantt/view/Gantt#property-visibleDate

Also you may use
https://bryntum.com/products/gantt/docs/api/Gantt/view/Gantt#function-scrollToDate

For example this demo shows use of visibleDate and scrolling to some exact date
https://bryntum.com/products/gantt/examples/infinite-scroll/

If that is not sufficient, please attach some test case application for us to see how you pass data to Gantt and the result.
Also provide some screenshot describing what is not in place?


Post by michal.sidlo »

Hi, you did not understand the problem. Is is not about visible date or scrolling, it is about rescheduling the events by the gantt - moving the starts of the stages.

Here is my test application:

    const gantt = new Gantt({
      appendTo: document.body,
      columns: [
        { type: 'name' },
        { type: 'startdate', format: 'DD.MM.YYYY' },
        { type: 'enddate', format: 'DD.MM.YYYY' },
        { type: 'effort' }
      ],
      rowHeight: 30,
      scrollTaskIntoViewOnCellClick: true,
      features: {
        dependencies: {
          radius: 100,
          clickWidth: 5
        },
        timeRanges: {
          showCurrentTimeLine : true
        }
      },
      viewPreset: {
        base: 'weekAndDayLetter',
        headers: [
          { unit: 'month', dateFormat : 'YYYY / MM' },
          { unit: 'day', dateFormat: 'DD' }
        ]
      },
  });

The data I already provided.


Post by arcady »

Hello,

The Gantt schedules tasks to take their ASAP dates (or ALAP if the project is scheduled backwards).
So if you want a task to start later you need to enforce this with a constraint. To give it a reason to be at that date.
Start/end dates are calculated values for the Gantt.
Try providing Start No Earlier Than constraints to your tasks. Like this for example:

{
    "project": {
        "calendar": "general",
        "startDate": "2023-11-08T00:00:00"
    },
    "calendars": {
        "rows": [
            {
                "id": "general",
                "name": "General",
                "intervals": [
                    {
                        "recurrentStartDate": "on Sat at 0:00",
                        "recurrentEndDate": "on Mon at 0:00",
                        "isWorking": false
                    }
                ]
            }
        ]
    },
    "tasks": {
        "rows": [
            {
                "id": "M225",
                "name": "Stage 1",
                "startDate": "2023-11-10T00:00:00",
                "constraintType": "startnoearlierthan",
                "constraintDate": "2023-11-10T00:00:00",
                "endDate": "2023-11-22T23:59:00",
                "expanded": true,
                "percentDone": 0,
                "effort": 0.0,
                "url": "Default.aspx?newtab-form-189-id-225",
                "index": 1,
                "children": [
                    {
                        "id": "T13124",
                        "name": "Task 1.1",
                        "startDate": "2023-11-10T00:00:00",
                        "endDate": "2023-11-20T23:59:00",
                        "percentDone": 0,
                        "effort": 168.0,
                        "url": "Default.aspx?newtab-form-87-id-13124",
                        "index": 1
                    },
                    {
                        "id": "T13121",
                        "name": "Task 1.2",
                        "startDate": "2023-11-20T00:00:00",
                        "endDate": "2023-11-22T23:59:00",
                        "percentDone": 0,
                        "effort": 0.0,
                        "url": "Default.aspx?newtab-form-87-id-13121",
                        "index": 2
                    }
                ]
            },
            {
                "id": "M226",
                "name": "Stage 2",
                "startDate": "2023-11-28T00:00:00",
                "constraintType": "startnoearlierthan",
                "constraintDate": "2023-11-28T00:00:00",
                "endDate": "2023-12-06T23:59:00",
                "expanded": true,
                "percentDone": 0,
                "effort": 0.0,
                "url": "Default.aspx?newtab-form-189-id-226",
                "index": 2,
                "children": [
                    {
                        "id": "T13123",
                        "name": "Task 2.1",
                        "startDate": "2023-11-28T00:00:00",
                        "endDate": "2023-12-06T23:59:00",
                        "percentDone": 0,
                        "effort": 168.0,
                        "url": "Default.aspx?newtab-form-87-id-13123",
                        "index": 1
                    }
                ]
            },
            {
                "id": "M227",
                "name": "Stage 3",
                "startDate": "2023-12-11T00:00:00",
                "constraintType": "startnoearlierthan",
                "constraintDate": "2023-12-11T00:00:00",
                "endDate": "2023-12-14T23:59:00",
                "expanded": true,
                "percentDone": 0,
                "effort": 0.0,
                "url": "Default.aspx?newtab-form-189-id-227",
                "index": 3,
                "children": []
            }
        ]
    },
    "dependencies": {
        "rows": [
            {
                "id": "D35",
                "fromEvent": "M225",
                "toEvent": "M226",
                "type": 2,
                "lag": 0
            }
        ]
    },
    "resources": {
        "rows": []
    },
    "assignments": {
        "rows": []
    }
}

Another option is making tasks manually scheduled but in that case the tasks are meant to be handled by user and won't be affected by dependencies.

More info on the scheduling process can be read here: https://bryntum.com/products/gantt/docs/guide/engine/gantt_events_scheduling

Best regards,
Arcady


Post by michal.sidlo »

Thank you very much, is solved my problem!


Post Reply