[reportlab-users] Re: setProperties for LinePlot

Berthold Höllmann reportlab-users@reportlab.com
Tue, 29 Jul 2003 14:53:36 +0200


Robin Becker <robin@reportlab.com> writes:

> In article <se65lm6bg1.fsf@pc020549.dhcp.germanlloyd.org>, Berthold
> Höllmann <hoel@gl-group.com> writes
>>Hello,
>>
>>I try to "setPropertie" for a linePlot. My problem is, how do I set
>>the properties for the individual lines? lp.getProperties() returns 
>>
>>...
>> 'lines': <reportlab.graphics.widgetbase.TypedPropertyCollection instance at 
>>0x4051fa4c>,
>>...
>>
>>but 
>>
>>lp.lines.setProperties({
>>        '[0].strokeDashArray': None,
>>        '[1].strokeDashArray': [2, 1],
>>        '[2].strokeDashArray': [1, 1]})
>>
> ..... this isn't going to work as we haven't done the parsing for the
> []. prefix. However, you can just do.
>
> lp.lines[0].strokeDashArray = None
> lp.lines[1].strokeDashArray = [2,1]
>
> etc

I know this, but I am trying to do lots of similat plots and wanted to
make the layout definitions on one place. In the meantime I decided to
subclass LinePlot and do the fiddeling in the __init__ routine.

Thanks
Berthold
-- 
Dipl.-Ing. Berthold Höllmann   __   Address:
hoel@GL-Group.com           G /  \ L Germanischer Lloyd
phone: +49-40-36149-7374    -+----+- Vorsetzen 32/35    P.O.Box 111606
fax  : +49-40-36149-7320      \__/   D-20459 Hamburg    D-20416 Hamburg