[Zope] Displaying Graphs using TAL

Tino Wildenhain tino at wildenhain.de
Fri May 30 03:29:46 EDT 2008


Hi,

Andyy wrote:
> i am preparing graphs(MatPlotLib) related files using external methods., 
> when i test them on zope they display very well there.
> 
> But when i call these external methods using tal as:
> 
> <Img tal:attributes="src python: context.IterationBar(context) "/>
> where IterationBar is my external method that displays a BarChart.

No, well you need to understand how HTTP/HTML works. If you have
a method which outputs the data of the image, you can point your
browser to it and it will load. If you want to embed the image
into a HTML page you need to give the link to the method in
<img src="..." /> _not_ the image data itself (look into
document source in your browser to find out about the difference.

In short, the very URL you have in your address bar when you view
the image itself should go into src= attribute.

Sounds easy, yes? Give it a try :-)

Tino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3241 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.zope.org/pipermail/zope/attachments/20080530/7bfe5f6f/smime.bin


More information about the Zope mailing list