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) 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.