Our state of the art Gantt chart


Post by pawel.szwak »

Hi,

I need set styles to gantt baseline.

https://www.bryntum.com/docs/gantt/#Gantt/model/Baseline

According to the documentation, I set the style property(details in attachement)

in my config is configuration for baselines only this
features : {
        baselines: true,
I have something else to set up?
Attachments
g1.PNG
g1.PNG (162.84 KiB) Viewed 2112 times

Post by saki »

You cannot apply style to baselines like that. You need a css class to change the look. For example:
.b-task-baseline[data-index="0"] {
  background-color: red;
}
See the source of baselines demo, especially file `resources/app.css`.

Post by Gantt_user »

saki wrote: Fri Feb 28, 2020 7:56 pm

You cannot apply style to baselines like that. You need a css class to change the look. For example:

.b-task-baseline[data-index="0"] {
  background-color: red;
}

See the source of baselines demo, especially file resources/app.css.

So we cannot use the style attribute?

I was able to apply styling to the baseline using a css class but that requires a fixed color. What if the color is dynamic where it could be anything?


Post by saki »

That is not yet supported. I have created feature request: https://github.com/bryntum/support/issues/2873


Post by Gantt_user »

saki wrote: Thu May 13, 2021 4:41 pm

That is not yet supported. I have created feature request: https://github.com/bryntum/support/issues/2873

Thanks for the quick response.

Would there be a workaround to apply dynamic styling? I can't override the css class for the baseline with a specific color as the color can change dynamically.


Post by saki »

One way I can think of as a workaround would be to create css rules dynamically https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet However, we have not tested it and it might, depending on the complexity of your gantt, lead to some performance degradation.

You can also sponsor the feature at https://bryntum.com/services to expedite its implementation.


Post by jashworth »

I've outlined a CSS-in-JS approach to styling tasks in this issue that could be applied to baselines. In that snippet, runningColor is not known until runtime.

HTH


Post by saki »

Thank you for the info @jashworth.


Post Reply