Our state of the art Gantt chart


Post by shimnx »

How to display weeks (the week of the year) in the calendar section on the right side of GANTT

Attachments
屏幕截图 2022-06-30 132913.png
屏幕截图 2022-06-30 132913.png (37.43 KiB) Viewed 372 times

Post by tasnim »

Please study docs : https://bryntum.com/docs/gantt/api/Scheduler/preset/ViewPreset

Here is a sample code snippet:

viewPreset : {
	headers : [
		{
			unit : 'week',
			renderer: (startDate, endDate) => `Week ${DateHelper.format(startDate, 'WW')}`
		}
	]
}

Post by shimnx »

   ganttConfig = {
        readOnly: false,

    listeners: {
    
     
     
    },
    viewPreset : {
        headers : [
            {
                unit : 'week',
                renderer: (startDate, endDate) => `Week ${DateHelper.format(startDate, 'WW')}`
            }
        ]
    }
    }

It was an error

 <bryntum-gantt  (onDataChange)="syncData($event)" style="height:100%;"
            #gantt
            [viewPreset]="ganttConfig.viewPreset"
           ...
            ></bryntum-gantt>
Attachments
屏幕截图 2022-06-30 142438.png
屏幕截图 2022-06-30 142438.png (31.65 KiB) Viewed 362 times

Post by tasnim »

You can put it inside of the ganttConfig like this:

ganttConfig = {
	...
	viewPreset: {
		timeResolution: {
			unit     : 'day',
			increment: 1
		},
		headers: [
			{
				unit    : 'week',
				renderer: (startDate, endDate) => `Week ${DateHelper.format(startDate, 'WW')}`
			}
		]
	}
}

Post by shimnx »

Now I can display it successfully.But there seems to be something wrong with the style

Attachments
屏幕截图 2022-06-30 145208.png
屏幕截图 2022-06-30 145208.png (15.66 KiB) Viewed 361 times
屏幕截图 2022-06-30 145148.png
屏幕截图 2022-06-30 145148.png (6.26 KiB) Viewed 361 times

Post by tasnim »

Could you please point out which styles seems wrong to you?


Post by shimnx »

Why is there an extra highlight

Attachments
屏幕截图 2022-06-30 150704.png
屏幕截图 2022-06-30 150704.png (16.08 KiB) Viewed 360 times

Post by tasnim »

Maybe you have some non-working time on that. Could you please provide calendar data so that I can check?


Post Reply