feat: add color to bars

This commit is contained in:
Safwan Samsudeen 2025-01-08 15:30:04 +05:30
parent 34422d1886
commit 65ea2377db
2 changed files with 3 additions and 4 deletions

View File

@ -116,6 +116,7 @@ export default class Bar {
: ''),
append_to: this.bar_group,
});
if (this.task.color) this.$bar.style.fill = this.task.color;
animateSVG(this.$bar, 'width', 0, this.width);
if (this.invalid) {
@ -157,6 +158,8 @@ export default class Bar {
class: 'bar-progress',
append_to: this.bar_group,
});
if (this.task.color_progress)
this.$bar_progress.style.fill = this.task.color;
const x =
(date_utils.diff(
this.task._start,
@ -205,7 +208,6 @@ export default class Bar {
);
}
this.progress_width = progress_width;
console.log(progress_width);
return progress_width;
}

View File

@ -308,7 +308,6 @@ export default class Gantt {
padding_end.duration,
padding_end.scale,
);
console.log(this.gantt_start, this.gantt_end);
} else {
this.gantt_start = date_utils.add(
gantt_start,
@ -325,7 +324,6 @@ export default class Gantt {
this.config.format_string =
this.config.view_mode.format_string || 'YYYY-MM-DD HH';
this.gantt_start.setHours(0, 0, 0, 0);
console.log(this.gantt_start);
}
setup_date_values() {
@ -1186,7 +1184,6 @@ export default class Gantt {
}
$.on(this.$container, 'scroll', (e) => {
console.log('f', e.target.scrollLeft);
let localBars = [];
const ids = this.bars.map(({ group }) =>
group.getAttribute('data-id'),