[reportlab-users] Graphics and titles

JP Glutting jpglutting at vqp.udl.es
Wed Jul 6 04:16:43 EDT 2005


Now this may sound like a stupid question, but where do I get the 
generator for the String object? The class definition? I can't find it 
(and Win XP's search tool is total crap).

It does not seem to be in platypus, pdfgen or pdfbase.

Or do you mean PDFString?

Thanks!

JP

Andy Robinson wrote:

> JP Glutting wrote:
>
>> Just a question to see if anyone has any ideas. I use a lot of line 
>> charts and bar charts, and, as far as I can tell from looking at the 
>> code, there is no way to make the title of the chart part of the 
>> Drawing image. Maybe I missed something.
>>
>> So, what I have been doing is printing out the title, and then 
>> putting the graphic right after it. That is fine if I keep close 
>> control of what goes on a page, but right now I have a very long 
>> series of charts I want to generate automatically (survey questions 
>> and their responses). The method of printing the title and then 
>> printing the graphic often results in the survey question being 
>> printed at the end of one page, and the graphic at the head of the 
>> next one. If I could insert the title into the graphic, they would 
>> stay together, and that would be the best solution.
>>
>> Failing that, does anyone have any good ideas about how to keep the 
>> two elements on the same page?
>
>
> You can add any number of objects to a Drawing - titles, legends, charts
> etc.  Just add a String node and call it title e.g.
>
>     d = Drawing()
>     vbc = VerticalBarChart()
>
>     #add it to the drawing.
>     d.add(vbc, name='chart')
>         #now refer to it...
>     d.chart.x = 50
>
>     #add a String object as the title
>     d.add(String(180,180, "Profits for February"), name="title")
>       #now customize it further
>     d.title.fontName = 'Helvetica-Bold'
>
>
> Hope this helps,
>
>
> Andy Robinson
>
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users



-- 
____________________________________________________

Oficina de Qualitat	 	Tel: 973 703 103			
Universitat de Lleida	   	Fax: 973 702 036	

Pl. Víctor Siurana, 1	
25003 Lleida	
____________________________________________________	



More information about the reportlab-users mailing list