Our state of the art Gantt chart


Post by dyressai »

Hi,

We have using the bryntum gantt but the baselines for MPP import doesn't work for us. We have picked the code from following example but it work with start/end date of task not with baseline.

https://www.bryntum.com/examples/gantt/baselines/

We need to baseline work with "baselineStartDate" and "baselineEndDate" fields inside the json file. Here's the json file:
https://atomplanner.com/gantt/projects/jobs/studies01_withbaselines.json

Below the baseline working now:
https://atomplanner.com/gantt/services/import/?optimize=studies01_withbaselines.json&kanvas=studies01_withbaselines

Can you please let me know asap. So we will integrate that in correct way.

Thanks


Post by alex.l »

Looks like the problem in data format.
taskRecord.baselines is an array of https://bryntum.com/docs/gantt/#Gantt/model/Baseline records.
That won't be easy to use it with your data format and requires in overriding of private methods. We do not recommend to rely on private methods in your solutions since we can change them without any notification.
The easiest way is to prepare your data to correct format after you got the response and before you apply it.

All the best,
Alex

All the best,
Alex


Post by dyressai »

Hi Alex,

When we upload the MPP file with baselines then json created same which I shared rather the baselines as array.
https://dev.bryntum.com/examples/gantt-vanilla/examples/msprojectimport/index.html

https://atomplanner.com/gantt/projects/jobs/studies01_withbaselines.json

How we can handle that baselines with array?

Thanks


Post by dyressai »

Hi Alex,

I cannot understand what you suggest because we did not create any new date format.
We are using the same data format from the JSON that we collected using Brynthum.

1) I upload an MPP
2) I use Brynthum to get a JSON file
3) I update the same JSON with new dates, using its original data format
4) I want to upload back this JSON to Brynthum and I want to see that the Baseline can be displayed.

So, I do not understand when you say we need to change the date format. Please explain.


Post by Maxim Gorkovsky »

Let me rephrase that. Baselines in new Gantt can only work if you provide input of the following format:

{
  name : 'task 1',
  baselines : [{ startDate : ..., endDate : ... }, ...]
}

So before you load data into the new Gantt you have to transform it to the correct format.


Post by dyressai »

But When we import the mpp file then the baseline format is different from which you said.

We have used the following example to import MPP file.
https://dev.bryntum.com/examples/gantt-vanilla/examples/msprojectimport/index.html

Can you please check response with baseline file then let us know.

Thanks


Post by Maxim Gorkovsky »

Indeed, our demo does not show how to properly add baselines. I opened ticket to improve the demo: https://github.com/bryntum/support/issues/2755 Thank you for report.

But anyway this is not a core code, so feel free to make local implementation. As I said, only thing you need is to convert baseline fields to separate record:

processTask(data) {
    const
        me = this,
        { id, children } = data;

    delete data.children;
    delete data.id;
    delete data.milestone;

    if ('baselineStartDate' in data && 'baselineEndDate' in data) {
        data.baselines = [{ startDate : data.baselineStartDate, endDate : data.baselineEndDate }];
        delete data.baselineStartDate;
        delete data.baselineEndDate;
    }

    data.calendar = me.calendarMap[data.calendar];

    const t = new me.taskStore.modelClass(data);

    if (children) {
        t.appendChild(me.getTaskTree(children));
    }

    t._id = id;
    me.taskMap[t._id] = t;

    return t;
}

Post Reply