# Progress Bar in the Power Table?

**URL:** <https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487>\
**Category:** Ignition\
**Created:** [September 21, 2015, 2:50pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487 "2015-09-21T14:50:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cas](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Cas](https://forum.inductiveautomation.com/u/Cas)\
**Post date:** [September 21, 2015, 2:50pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/1 "2015-09-21T14:50:54Z")

</div>

Hi all,  
I need to use an embedded Progress Bar (only available in Table component) but also need the Cell Spanning feature (only available in Power Table component)… It seems mutually exclusive.

So, is there any way to do Cell Spanning in a regular Table OR an embedded Progress Bar in the Power Table (OR some other clever alternative)?

Thanks for your ideas & help!

Cas

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [September 21, 2015, 9:55pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/2 "2015-09-21T21:55:03Z")

</div>

Try this in the configureCell extension function of the power table:

`if colIndex==0:
		from javax.swing import JProgressBar
		bar = JProgressBar(0, 100)
		bar.setValue(value)
		return {"renderer": bar}`

Obviously, yours may not be columns zero and may not be between 0 and 100, adjust as needed.

---

<div class="post-metadata">

**Author:** ![Cas](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Cas](https://forum.inductiveautomation.com/u/Cas)\
**Post date:** [September 22, 2015, 2:52pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/3 "2015-09-22T14:52:06Z")

</div>

Carl,  
Thanks for the quick reply… It works great!  
Now my next (final?) question is how to change the colors of the foreground (the bar itself) and background (the field that the bar sits against)? For example, if I want a red bar against a white background, how do I code that?

\*Note (no action needed - just a fun fact…):  
I noticed that the configureCell extension function seems to be hierarchical - if I put the progress bar snippet you gave me AFTER the included script for alternating row color, the bars would not appear. But if I put the snippet BEFORE the other script, it would work fine.

Thanks again,  
Cas

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [September 22, 2015, 4:04pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/4 "2015-09-22T16:04:41Z")

</div>

Just add the following

` bar.background = Color.WHITE
	  bar.foreground = Color.RED`

---

<div class="post-metadata">

**Author:** ![Cas](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Cas](https://forum.inductiveautomation.com/u/Cas)\
**Post date:** [September 22, 2015, 5:57pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/5 "2015-09-22T17:57:44Z")

</div>

jpark,  
When I add those lines to my code, the progress bars disappear.

Prior to me adding the lines, I had:

`	if colName=="Order":
		     from javax.swing import JProgressBar	
		     bar = JProgressBar(0, 100)
		     bar.setValue(value)
		     return {'renderer': bar}`  
And I saw gray progress bars.

Afterwards I had:

`	if colName=="Order":
		     from javax.swing import JProgressBar	
		     bar = JProgressBar(0, 100)
		     bar.setValue(value)
		     bar.background = Color.WHITE
		     bar.foreground = Color.RED
		     return {'renderer': bar}`  
And the bars disappeared and were replaced with their values.

What am I doing wrong??

Thanks,  
Cas

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [September 22, 2015, 11:41pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/6 "2015-09-22T23:41:37Z")

</div>

You need to add the import.

[code]if colName==“Order”:  
from javax.swing import JProgressBar  
from java.awt import Color

```
 bar = JProgressBar(0, 100)
 bar.setValue(value)
 bar.background = Color.WHITE
 bar.foreground = Color.RED
 return {'renderer': bar}[/code]
```

---

<div class="post-metadata">

**Author:** ![Cas](https://avatars.discourse-cdn.com/v4/letter/c/77aa72/32.png) [@Cas](https://forum.inductiveautomation.com/u/Cas)\
**Post date:** [September 22, 2015, 11:59pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/7 "2015-09-22T23:59:34Z")

</div>

Awesome, thank you so much!  
It works perfectly.

Thanks,  
Cas

---

<div class="post-metadata">

**Author:** ![Herbie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/herbie/32/65288_2.png) [@Herbie](https://forum.inductiveautomation.com/u/Herbie)\
**Post date:** [February 25, 2019, 10:44pm UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/8 "2019-02-25T22:44:03Z")

</div>

I am trying to build off these examples and utilize the indeterminate property to just animate the progress bar that has unknown steps to complete. I have this code in _configureCell_, but it only shows about 20% of the bar, stuck to the left. It’s as if the animation piece isn’t executing when it is embedded in the power table.

```auto
if colName == "Status":
		from javax.swing import JProgressBar
		from java.awt import Color
		
		bar = JProgressBar(0,100)
		bar.background = self.parent.parent.LightColor
		bar.foreground = self.parent.parent.DarkColor
		
		bar.setIndeterminate(value)
		
		return {'renderer': bar}
```

My status column is a boolean. Thoughts as to why it’s not animated like a progress bar component is with the indeterminate value set?

---

<div class="post-metadata">

**Author:** ![pawel.kondol1](https://avatars.discourse-cdn.com/v4/letter/p/54ee81/32.png) [@pawel.kondol1](https://forum.inductiveautomation.com/u/pawel.kondol1)\
**Post date:** [August 19, 2022, 11:03am UTC](https://forum.inductiveautomation.com/t/progress-bar-in-the-power-table/10487/9 "2022-08-19T11:03:47Z")

</div>

> [@Herbie](#):
>
> `JProgressBar`

is it possible to have value displayed at the same time. At the moment I can display value or progress bar but not both.
