Equipment scheduler conditional coloring

Hi,
I would like to use Equipment Schedule as a downtime followup tool. I have setup the related parts and achieved following:
EquipmentScheduleBarColor.pdf (151.4 KB)
I would like to follow up 8 different reasons and would like to color the related bar based on the content of the related reason.
So I would like to color the bar on EquipmentSchedule based on the value on a table-column or db-table-column of the equipment schedule bar. eg. If no entry then black, if "Vacation" written then "green"...

Typically, the data for your equipment schedule would be coming from a database. In that case, you just write a case statement in the SQL to output a color based on another column value.

Hi, Thanks for your reply.
I specifically need to know how each individual bar will be colored based on the data in the respected column. Where exactly to bind for individual bars(events)?
Or should I have a loop?
Perhaps, a bit more clarification from you will help.

I use a query to create my events data, here is an example of how I can change background color based on some other column (plant number in this case).

SELECT 
	tx_id as eventId,
	start_time as startDate,
	end_time as endDate,
	driver as itemId,   
	trailer_id as label,
	lead_time as leadTime, 
	case 
		when to_plant = 1 then '#00FFFF' 
		when to_plant = 3 then '#FFFF47' 
		when to_plant = 4 then '#FF47FF'
		when to_plant = 6 then '#FFAC47' 
		else '#AAAAAA' 
	end as backgroundColor, 
	'black' as fontColor,
	'solid' as borderStyle,
	1 as borderWidth,
	'var(--neutral-70)' as borderColor
	
FROM 
...
1 Like

Thanks for the solution.

1 Like