I'm trying to build a legend (through a Table) with Reportlab. The table should have three lines and two columns, each i, j element being a ListItem with a colored bullet point. Here is the code:
ptext = '<font size=10><b><i>Legend:</i></b></font>'
light = []
mild = []
strong = []
#Create the table
ptext = '<font size=10>Light Barrier</font>'
light.append(ListFlowable(ListItem(Paragraph(ptext, styles["Normal"]),
bulletColor = lightRed, value = 'circle'), bulletType = 'bullet', start = 'circle'))
ptext = '<font size=10>Light Benefit</font>'
light.append(ListFlowable(ListItem(Paragraph(ptext, styles["Normal"]),
bulletColor = lightGreen, value = 'circle'), bulletType = 'bullet', start = 'circle'))
ptext = '<font size=10>Mild Barrier</font>'
mild.append(ListFlowable(ListItem(Paragraph(ptext, styles["Normal"]),
bulletColor = mildRed, value = 'circle'), bulletType = 'bullet', start = 'circle'))
ptext = '<font size=10>Mild Benefit</font>'
mild.append(ListFlowable(ListItem(Paragraph(ptext, styles["Normal"]),
bulletColor = mildGreen, value = 'circle'), bulletType = 'bullet', start = 'circle'))
ptext = '<font size=10>Strong Barrier</font>'
strong.append(ListFlowable(ListItem(Paragraph(ptext, styles["Normal"]),
bulletColor = strongRed, value = 'circle'), bulletType = 'bullet', start = 'circle'))
ptext = '<font size=10>Strong Benefit</font>'
strong.append(ListFlowable(ListItem(Paragraph(ptext, styles["Normal"]),
bulletColor = strongGreen, value = 'circle'), bulletType = 'bullet', start = 'circle'))
#Append them to the table
data = [light, mild, strong]
t = Table(data)
Story.append(t)
The error I get says:
"ListItem is not iterable".
Any help is appreciated.