This is a migrated thread and some comments may be shown as answers.

Gantt tasks are shifted to the right

1 Answer 62 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Mohamed
Top achievements
Rank 1
Mohamed asked on 02 Dec 2020, 02:41 PM

The tasks are placed in wrong date in the chart panel.

 

for example: the "T2" task has start date (20/10/2020) and end date (23/10/2020) but in the chart is placed in (6/11) - (9/11).

 

this is the configuration I used for rendering the component: 

kendo.jQuery(chartElement).kendoGantt({
    views: [{type: 'week', selected: true, slotSize: 30}],
    rowHeight: 10,
    toolbar: ['pdf'],
    listWidth: "0%",
    editable: false,
    selectable: true,
    tooltip: {
        visible: true,
        template: `#= task.tooltip #`
    },
    range: {
        start: new Date(this.model.startDate),
        end: new Date(this.model.endDate)
    },
    showWorkDays: false,
    workDayStart: this.model.startDate,
    workDayEnd: this.model.endDate,
    taskTemplate: `<div style="background-color: #= backgroundColor #; padding: 4px 8px; border-radius: 2px"> #= title # </div>`,
});

 

// this is how I added data into the chart

const dataSource = new kendo.data.GanttDataSource({
    data: this.listOfScheduleTasksForGanttChart.map(task => {
        const startDate = new Date(task[this.ganttChartTasksGridStartDate]);
        const endDate = new Date(task[this.ganttChartTasksGridEndDate]);
        return {
            id: task.scheduleTaskId,
            orderId: task.sortId,
            parentId: task.parentId,
            title: task.taskName,
            start: startDate,
            end: endDate,
            backgroundColor: task.backColor,
            expanded: true,
            tooltip: task.toolTip
        }
    })
});

 

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 04 Dec 2020, 11:06 AM

Hi Mohamed,

I tested the reported behavior but failed to observe the reported issue. Is it possible that the passed start and end dates are not correct?

I created a sample dojo to test the behavior. Can you update it so the issue is reproducible and send it back to me for further investigation? This way I can provide a better suggestion on how to resolve the issue.

Regards,
Aleksandar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Gantt
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or