Skip to main content
Solved

How do you change the text color of the bar on a Gantt chart?

  • April 11, 2019
  • 3 replies
  • 248 views

MathFour
AIMMS Partner
Forum|alt.badge.img
I have a Gantt chart in WinUI that I'm trying to replicate in WebUI. The bars are colored based on the data (and a small bit of logic). I also have text on the bars.

The only way I can find to make sure the text shows up is change the css. But the text doesn't respond to anything but the stroke property.

Here's the css, and below is the result:

code:
.aimms-widget .tag-ganttchart .annotation-Red_100\% {
stroke: black;
fill: rgb(255,50,50);
}

.aimms-widget .tag-ganttchart .annotation-Green_100\% {
stroke: white;
fill: rgb(50,255,50);
}

.aimms-widget .tag-ganttchart .annotation-Blue_100\% {
stroke: white;
fill: rgb(50,50,255);
}

.aimms-widget .tag-ganttchart .annotation-Orange_100\% {
stroke: black;
fill: rgb(255,153,50);
}



Is there any other way to change the text without also having the stroke around the bar change?

Thanks!
~Bon

Best answer by Imke

Hi @MathFour ,

We use
.aimms-widget .tag-ganttchart .bar.annotation-Red {
stroke: (for border)
fill: (for background)
}

.aimms-widget .tag-ganttchart .label.annotation-Red {
fill: (for text color)
}

Maybe that helps?

3 replies

MathFour
AIMMS Partner
Forum|alt.badge.img
  • Author
  • AIMMS Partner
  • 57 replies
  • April 12, 2019
More information on the font color situation...

The fill property fills both the bar and the text, BUT when you hover, it only fills the bar (and not the text):



Khang.Bui
  • Former AIMMSian
  • 4 replies
  • April 16, 2019
Hi @MathFour

We're currently looking into this and will get back with more information as soon as we can!

Forum|alt.badge.img
  • AIMMS Partner
  • 3 replies
  • Answer
  • April 23, 2019
Hi @MathFour ,

We use
.aimms-widget .tag-ganttchart .bar.annotation-Red {
stroke: (for border)
fill: (for background)
}

.aimms-widget .tag-ganttchart .label.annotation-Red {
fill: (for text color)
}

Maybe that helps?


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator