Closed jalle007 closed 6 years ago
@netchampfaris
can you please help me to setup basic chart like this
You can add a class to your gantt bar using the custom_class
property, and style it using css.
I had to add this to frappe-gantt.js:
draw_bar() {
this.$bar = createSVG('rect', {
x: this.x,
y: this.y,
width: this.width,
height: this.height,
rx: this.corner_radius,
ry: this.corner_radius,
class: 'bar' + this.task.custom_class, //added ' + this.task.custom_class'
append_to: this.bar_group
});
animateSVG(this.$bar, 'width', 0, this.width);
if (this.invalid) {
this.$bar.classList.add('bar-invalid');
}
}
I know this is an old issue, but I wanted to share my solution since I couldn't find it anywhere:
let tasks = { id: 1, custom_class: 'cc-red' ... }
// your css file
.cc-red g rect { fill: red !important; }
Please, this is fundamental requirements