RE:Help:Displaying generated chart (Neil Brooks)
Reimar Bauer <[email protected]>
| Newsgroups | gmane.comp.web.wiki.moin.devel |
|---|---|
| Organization | FZ-Jülich |
| Message-ID | <[email protected]> |
> Message: 2 > Date: Thu, 01 Apr 2004 18:27:56 +0100 > From: Neil Brooks <[email protected]> > To: [email protected] > Subject: [Moin-devel] Help:Displaying generated chart > > Hi, > > I am working on modifying pagehits.py to use Yasuhi Saito's PyChart rather > than gdchart. I also thought that svg (xml) graphics would be neat. > > I am stuck on the way to display the generated svg data. > Do I dump it into a file and set up an img link? If so, where should I > store the file? > > Or do I simply create an inline image by dumping the content straight into > the displayed page? If so, I can't seem to create the right html to display > the chart. What is the sequence of request.writes() to get the image in the > middle of the page? Do I need a macro calling my action? > > What is the MoinMoin way, Oh learned ones? > > Neil Dear Neil I would prefer to have the image stored as file but its only temporary data. You better watch what someone else says to this point. if you take a look into the latex.1.2.1.py you find these lines: (http://moinmoin.wikiwikiweb.de:8000/ ProcessorMarket?action=AttachFile&do=get&target=latex.1.2.1.py) pagename=formatter.page.page_name url=AttachFile.getAttachUrl(pagename,imgname+'.png',request) attach_dir=AttachFile.getAttachDir(pagename,create=1) os.system("%(convert)s -crop 0x0 -density 120x120 %(vartmp)s/%(imgname)s.ps % (outpath)s" % { "convert": config_external_convert, "vartmp": vartmp, "outpath": attach_dir+'/'+imgname+'.png', "imgname": imgname, }) get it in the middle: request.write(formatter.image(src="%s" % url, alt=texstr, align='absmiddle')) Reimar
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQBAbPg45aOc3Q9hk/kRAv6QAJ91z9Cxn0WyXpdqRWYVn/fhOJKn8QCgi14P JYQ6o4UB+RMSmh9OsJezRoc= =BEz0 -----END PGP SIGNATURE-----