From 65ea2377db6a2dc6ef110175e35277dd8688fbc0 Mon Sep 17 00:00:00 2001 From: Safwan Samsudeen Date: Wed, 8 Jan 2025 15:30:04 +0530 Subject: [PATCH] feat: add color to bars --- src/bar.js | 4 +++- src/index.js | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bar.js b/src/bar.js index bb3b40b..252e3c4 100644 --- a/src/bar.js +++ b/src/bar.js @@ -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; } diff --git a/src/index.js b/src/index.js index 0bae1da..95b454a 100644 --- a/src/index.js +++ b/src/index.js @@ -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'),