I am using the latest version of Jython.
I have a barchart where I have one series and need to assign different colors to the items based on the item labels. I have looked everywhere and I cannot find a solution.
The data looks like this:
Grouping Count GroupName
VSWR_4M 960 CONNECTOR
PIM_4M 62 CONNECTOR
VSWR_DM 74 FLEXTYPE
VSWR_4R 99 LENGTHLABEL
I currently has the following subclass:
class CustomRenderer(BarRenderer):
def getItemPaint(self,row,column):
ds = self.getPlot().getDataset()
val = ds.getValue(row,column)
if val == 'CONNECTOR':
return Color(50,50,50)
if ds.getValue('GroupName',column) == 'CONNECTOR':
return Color(10,0,255)
elif ds.getValue('GroupName',column) == 'FLEXTYPE':
return Color(10,100,255)
elif ds.getValue('GroupName',column) == 'LENGTHLABEL':
return Color(10,200,255)
else:
return Color(200,200,100)