# Reporting top 10 bar chart colors

**URL:** <https://forum.inductiveautomation.com/t/reporting-top-10-bar-chart-colors/18550>\
**Category:** Ignition\
**Created:** [June 21, 2018, 12:03am UTC](https://forum.inductiveautomation.com/t/reporting-top-10-bar-chart-colors/18550 "2018-06-21T00:03:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nathan\_ICS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nathan_ics/32/4047_2.png) [@Nathan\_ICS](https://forum.inductiveautomation.com/u/Nathan_ICS)\
**Post date:** [June 21, 2018, 12:03am UTC](https://forum.inductiveautomation.com/t/reporting-top-10-bar-chart-colors/18550/1 "2018-06-21T00:03:12Z")

</div>

How do I make each bar a different color for a top 10 graph in a report?

I found this where you can [change the color based on the value in the scripting(below)](http://forum.inductiveautomation.com/t/reporting-bar-chart-colors/11517) and it works fine for that but I can’t figure out how to make it work for my case.

Thanks

```
from org.jfree.chart.renderer.category import BarRenderer
from java.awt import Color
class myBarRenderer(BarRenderer):
	def getItemPaint(self, row, column):
		v = chart.getCategoryPlot().getDataset().getValue(row, column)
		if v < 70:
			return Color.blue
		else:
			return Color.red
plot = chart.getCategoryPlot()
plot.setRenderer(myBarRenderer())

```

\*Edited so it actually made sense.

---

<div class="post-metadata">

**Author:** ![Nathan\_ICS](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nathan_ics/32/4047_2.png) [@Nathan\_ICS](https://forum.inductiveautomation.com/u/Nathan_ICS)\
**Post date:** [June 21, 2018, 1:44pm UTC](https://forum.inductiveautomation.com/t/reporting-top-10-bar-chart-colors/18550/2 "2018-06-21T13:44:15Z")

</div>

I edited my original post because after I read it again it was not very clear.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 21, 2018, 1:47pm UTC](https://forum.inductiveautomation.com/t/reporting-top-10-bar-chart-colors/18550/3 "2018-06-21T13:47:16Z")

</div>

Use the row or column (I can’t remember which, probably row) as an index into a constant list of colors. I suggest placing the code in a script module so the bulk of it only executes once.
