# How can I format the text of a progress bar in a Power Table

**URL:** <https://forum.inductiveautomation.com/t/how-can-i-format-the-text-of-a-progress-bar-in-a-power-table/79934>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [October 2, 2023, 4:34pm UTC](https://forum.inductiveautomation.com/t/how-can-i-format-the-text-of-a-progress-bar-in-a-power-table/79934 "2023-10-02T16:34:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [October 2, 2023, 4:34pm UTC](https://forum.inductiveautomation.com/t/how-can-i-format-the-text-of-a-progress-bar-in-a-power-table/79934/1 "2023-10-02T16:34:47Z")

</div>

Here is the code I have:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd96426c8c24546591c1c06b2ece5a1eba631eb8.png)

Here is what it is displaying:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/2/d2a585d54dd860652a77135dc68239721bae4c51.png)

I need to be able to change the color to make it readable, and I need to change the units to degrees Celsius instead of %. Can anyone help me with this?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 2, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/how-can-i-format-the-text-of-a-progress-bar-in-a-power-table/79934/2 "2023-10-02T16:44:37Z")

</div>

It's been a while since I've done this in vision, but this script should be an example to help you out. I'm not sure about the degrees symbol though

```auto
if colName == 'completed':
	from javax.swing import JProgressBar
	from java.awt import Color
	from java.awt import Font
	
	def setTextColor(jbar, color):
		jbar.putClientProperty("Synthetica.progressBar.textColor", color)
		
	minValue = 0.0
	maxValue = 100.0
	colora = Color.RED
	colorb = Color.GREEN
	
	reda = colora.getRed()
	greena = colora.getGreen()
	bluea = colora.getBlue()		
	redb = colorb.getRed()
	greenb = colorb.getGreen()
	blueb = colorb.getBlue()		
	ratio = value * 100
	
	foreColor = Color(71,169,230,255)
	if value > 0.75:
		backColor = Color(0,255,0,50)
	elif value > 0.35:
		backColor = Color(255,255,0,50)
	else:
		backColor = Color(255,0,0,50)
	
	jbar = JProgressBar(int(minValue), int(maxValue))
	
	fontColor = Color.BLACK
	if value > 0.52:
		fontColor = Color.WHITE
	setTextColor(jbar,fontColor)
	
	jbar.setValue(int(ratio))			
	jbar.setStringPainted(True)
	jbar.setForeground(foreColor)
	jbar.setBackground(backColor)
	jbar.font = Font("Dialog", 1, 14)
	return {"renderer": jbar}
	
elif colName == "Details":  
	from javax.swing import JButton
	return { 'renderer' : JButton('View') }
elif selected:
	return {'background':self.selectionBackground}
elif rowView % 2 == 0:
	return {'background':'#CCFFCC'}	
else:
	return {'background':'white'}	

```

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [October 2, 2023, 4:57pm UTC](https://forum.inductiveautomation.com/t/how-can-i-format-the-text-of-a-progress-bar-in-a-power-table/79934/3 "2023-10-02T16:57:40Z")

</div>

This was super helpful! I still need to know how to format the text though. Does anyone know how to do that?

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [October 2, 2023, 5:56pm UTC](https://forum.inductiveautomation.com/t/how-can-i-format-the-text-of-a-progress-bar-in-a-power-table/79934/4 "2023-10-02T17:56:52Z")

</div>

I figured out how to edit the display string. You can access it through bar.setString
