[reportlab-users] Graphics and titles

JP Glutting jpglutting at vqp.udl.es
Wed Jul 6 09:30:37 EDT 2005


Ok, I am trying a workaround for this thing, and it is giving me some 
odd errors. I tried breaking the string up into smaller strings, and 
printing each one seperately (with an offset, but I never get to the 
part where I calibrate that). When I do this, i get this error:

AssertionError: expected one category name but foud 6 in axis.
    categories = ['1. survey question']

Any idea what is going on here? It looks to me like the strings i am 
putting into this drawing are being interpreted as tick labels (almost 
certainly, because the function that returns the error is called 
makeTickLabels). I don't understand why that is - tha ta single string 
can be priinted, but multiple strings are intepreted as labels.

Thanks!

JP


JP Glutting wrote:

> No, no problem. I found it - just a little glitch. I only imported 
> Drawing from reportlab.graphics.shapes when I originally wrote this 
> (can't remember why), so I had to go tweak the imports, that is all.
>
> It looks really nice. The only problem is that I have some titles I 
> want to wrap (multi line). I am digging for tricks on doing that, but 
> if you happen to know offhand, that would be great.
>
> Thanks again!
> JP
>
> Andy Robinson wrote:
>
>>> It does not seem to be in platypus, pdfgen or pdfbase.
>>>
>>> Or do you mean PDFString?
>>>
>>>   
>>
>>
>> reportlab.graphics.shapes.String:
>>
>> class String(Shape):
>>    """Not checked against the spec, just a way to make something work.
>>    Can be anchored left, middle or end."""
>>
>>    # to do.
>>    _attrMap = AttrMap(
>>        x = AttrMapValue(isNumber),
>>        y = AttrMapValue(isNumber),
>>        text = AttrMapValue(isString),
>>        fontName = AttrMapValue(None),
>>        fontSize = AttrMapValue(isNumber),
>>        fillColor = AttrMapValue(isColorOrNone),
>>        textAnchor = AttrMapValue(isTextAnchor),
>>        )
>>
>>
>> When you said you were doign charts, I presumed using the
>> numerous Drawing and chart-related Shape objects in reportlab/graphics;
>> If this is not the case and you are drawing your own with pdfgen, 
>> then you have a large new subpackage to explore.  (it's been there 
>> for 4 years!)  The graphics guide and reference
>> are probably the starting point:
>>
>>   http://www.reportlab.com/docs/graphguide.pdf
>>  http://www.reportlab.com/docs/graphics_reference.pdf
>>
>>
>>
>> Best Regards,
>>
>>
>> Andy Robinson
>> _______________________________________________
>> reportlab-users mailing list
>> reportlab-users at reportlab.com
>> http://two.pairlist.net/mailman/listinfo/reportlab-users
>>  
>>
> __




More information about the reportlab-users mailing list