Hello, I am using Plone3 and zope2.10 I am trying *MatPlotLib graphics library* to generate graphs and chart. It gets displayed well on zope, but *i need to display it using page templates on one of the page on my plone site*. How do i Go about it? I am able to display it but not using standard plone template. Please help me how do i do that. Thanks!
--On 30. Mai 2008 11:43:37 +0530 Andyy <ggirotra@gmail.com> wrote:
Hello,
I am using Plone3 and zope2.10 I am trying *MatPlotLib graphics library* to generate graphs and chart. It gets displayed well on zope,
But does that mean?
but *i need to display it using page templates on one of the page on my plone site*. How do i Go about it?
I am able to display it but not using standard plone template.
ZPT does not display images. You generate proper <img> tags to the related resource. Where is the problem? Tell us what you have, tell us what you want to achieve. -ah
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. Or using <img src="/Agile/image.gif" tal:attributes="src context.IteartionBar(context)"/> It does not display me the image in *Default Plone Page, * Only the graph image gets displayed on a *blank page* not on Plone default page. I want it in a plone default page and not a new blank page. Why cant that image gets displayed with other contents of that page still there. On Fri, May 30, 2008 at 11:48 AM, Andreas Jung <lists@zopyx.com> wrote:
--On 30. Mai 2008 11:43:37 +0530 Andyy <ggirotra@gmail.com> wrote:
Hello,
I am using Plone3 and zope2.10 I am trying *MatPlotLib graphics library* to generate graphs and chart. It gets displayed well on zope,
But does that mean?
but *i need to display it using page
templates on one of the page on my plone site*. How do i Go about it?
I am able to display it but not using standard plone template.
ZPT does not display images. You generate proper <img> tags to the related resource. Where is the problem? Tell us what you have, tell us what you want to achieve.
-ah
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
--On 30. Mai 2008 12:38:21 +0530 Andyy <ggirotra@gmail.com> 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.
Or using
<img src="/Agile/image.gif" tal:attributes="src context.IteartionBar(context)"/>
1) the thing you're calling must return an *URL* not the image data itself...think about how the <img> in HTML works 2) The script called through the given url must return the image data _and_ it must set the proper http headers content-type, and content-length -aj
Andreas Jung a écrit :
--On 30. Mai 2008 12:38:21 +0530 Andyy <ggirotra@gmail.com> 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.
Or using
<img src="/Agile/image.gif" tal:attributes="src context.IteartionBar(context)"/>
1) the thing you're calling must return an *URL* not the image data itself...think about how the <img> in HTML works
2) The script called through the given url must return the image data _and_ it must set the proper http headers content-type, and content-length
If your site is only for FireFox or evolved browser you can use inline rendering: <img width="81" height="85" src="data:image/gif;base64,R0lGODlhUAAPAKIAAAsLav///88PD9WqsYmApmZmZtZfYmdakyH5BAQUAP8ALAAAAABQAA8AAAPb WLrc/jDKSVe4OOvNu/9gqARDSRBHegyGMahqO4R0bQcjIQ8E4BMCQc930JluyGRmdAAcdiigMLVr ApTYWy5FKM1IQe+Mp+L4rphz+qIOBAUYeCY4p2tGrJZeH9y79mZsawFoaIRxF3JyiYxuHiMGb5KT kpFvZj4ZbYeCiXaOiKBwnxh4fnt9e3ktgZyHhrChinONs3cFAShFF2JhvCZlG5uchYNun5eedRxM AF15XEFRXgZWWdciuM8GCmdSQ84lLQfY5R14wDB5Lyon4ubwS7jx9NcV9/j5+g4JADs="> -- Encolpe Degoute INGENIWEB (TM) - S.A.S 50000 Euros - RC B 438 725 632 Bureaux de la Colline 1 rue Royal 92210 Saint Cloud web : www.ingeniweb.com - « les Services Web Ingénieux » Tel : 01.78.15.24.08 / Fax : 01 47 57 39 14
--On 30. Mai 2008 10:20:28 +0200 Encolpe Degoute <encolpe.degoute@ingeniweb.com> wrote:
Andreas Jung a écrit :
--On 30. Mai 2008 12:38:21 +0530 Andyy <ggirotra@gmail.com> 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.
Or using
<img src="/Agile/image.gif" tal:attributes="src context.IteartionBar(context)"/>
1) the thing you're calling must return an *URL* not the image data itself...think about how the <img> in HTML works
2) The script called through the given url must return the image data _and_ it must set the proper http headers content-type, and content-length
If your site is only for FireFox or evolved browser you can use inline rendering: <img width="81" height="85" src="data:image/gif;base64,R0lGODlhUAAPAKIAAAsLav///88PD9WqsYmApmZmZtZfY mdakyH5BAQUAP8ALAAAAABQAA8AAAPb
WLrc/jDKSVe4OOvNu/9gqARDSRBHegyGMahqO4R0bQcjIQ8E4BMCQc930JluyGRmdAAcdiigM LVr
ApTYWy5FKM1IQe+Mp+L4rphz+qIOBAUYeCY4p2tGrJZeH9y79mZsawFoaIRxF3JyiYxuHiMGb 5KT
kpFvZj4ZbYeCiXaOiKBwnxh4fnt9e3ktgZyHhrChinONs3cFAShFF2JhvCZlG5uchYNun5eed RxM
AF15XEFRXgZWWdciuM8GCmdSQ84lLQfY5R14wDB5Lyon4ubwS7jx9NcV9/j5+g4JADs=">
Ouch :-) Andreas
Hi, Encolpe Degoute wrote: ...
If your site is only for FireFox or evolved browser you can use inline
not only Firefox. also Opera supports this for years :-) It is not totally ideal because of the overhead due to the base64-encoding. For graphs (as the op wants to show) I think in the long run SVG would be a better option (gnuplot can output SVG) Regards Tino
participants (4)
-
Andreas Jung -
Andyy -
Encolpe Degoute -
Tino Wildenhain