[reportlab-users] Limit on line graph?

Tim Roberts timr at probo.com
Wed Jun 27 13:17:18 EDT 2007


David Frank wrote:

> Hi,

>

> My mistake!!! There ARE more than three lines, but since I did not

> explicitly mention the colors of the lines, the three ReportLabColors

> of red, blue, and, green were taken as strokeColor for all of the

> lines. So, when I mentioned the colors explicitly as colors.red,

> colors.blue, colors.green, colors.purple, etc... it worked.

>

> But I still dont understand why len(infchart.lines) came up as 3,

> after counting the number of colors used. Bug? Or is it just my very

> little knowledge of the application? :-)


infchart.lines holds the styles to be used for the lines as they are
drawn, in rotation order. The constructor sets up three styles: red,
green, and blue. If you never add any additional styles to it, then
there will always be three. Lines 0, 1, 2, 3, 4 will be drawn with
style 0, 1, 2, 0, 1, respectively, from infchart.lines.

If you want to increase the number of styles in the rotation, just add
them yourself:
infchart.lines[4].strokeColor = colors.purple

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list