better columns VS nodes width and placement

This commit is contained in:
STEINNI committed 2026-10-14 12:26:44 +00:00
1 parent fcb1e535ca
commit df194dcb65
1 file changed
+5 -4
+5 -4
View File
@@ -30,7 +30,8 @@ class BZgantt extends Buildoz {
this.append(this.graflow) this.append(this.graflow)
this.fireEvent('domConnected', { gantt: this }) this.fireEvent('domConnected', { gantt: this })
this.dayWidth = this.getBZAttribute('daywidth') || 20 this.dayWidth = this.getBZAttribute('daywidth') || 20
this.dayWidthPadding = 10
if(this.getBZAttribute('nodesfile')) this.nodesfile = this.getBZAttribute('nodesfile') if(this.getBZAttribute('nodesfile')) this.nodesfile = this.getBZAttribute('nodesfile')
else this.initGantt() else this.initGantt()
const dataSrc = this.getBZAttribute('src') const dataSrc = this.getBZAttribute('src')
@@ -160,7 +161,7 @@ class BZgantt extends Buildoz {
"nodeType": "bar", "nodeType": "bar",
"id": task.id, "id": task.id,
"coords": { "coords": {
"x": startIdx * this.dayWidth, "x": (startIdx * this.dayWidth) + (startIdx > 0 ? this.dayWidthPadding : 0),
"y": curY, "y": curY,
}, },
"markup": markup "markup": markup
@@ -211,8 +212,8 @@ class BZgantt extends Buildoz {
for(let idx=0; idx<=endIdx; idx++){ for(let idx=0; idx<=endIdx; idx++){
const dayDiv = document.createElement('div') const dayDiv = document.createElement('div')
dayDiv.classList.add('day') dayDiv.classList.add('day')
dayDiv.style.left = `calc(var(--chart-left) + ${idx * this.dayWidth}px)` dayDiv.style.left = `calc(var(--chart-left) + ${idx * (this.dayWidth + this.dayWidthPadding)}px)`
dayDiv.style.width = this.dayWidth + 'px' dayDiv.style.width = (this.dayWidth + this.dayWidthPadding) + 'px'
dayDiv.innerHTML = '&nbsp;' + dayDate.getDate() dayDiv.innerHTML = '&nbsp;' + dayDate.getDate()
if(dayDate.toISOString().substring(0,10) == (new Date()).toISOString().substring(0,10)) dayDiv.classList.add('today') if(dayDate.toISOString().substring(0,10) == (new Date()).toISOString().substring(0,10)) dayDiv.classList.add('today')
dayDiv.setAttribute('title', new Intl.DateTimeFormat('fr-FR', { dayDiv.setAttribute('title', new Intl.DateTimeFormat('fr-FR', {