A friend asked about generating dynamic graph for a domino web application. I've been using Scalable Vector Graphic (SVG) to generate graph for some of my application so I recommended him that.
SVG is a language for describing two-dimensional graphics and graphical applications in XML. SVG can be use to create dynamic graph for your website. Dynamic SVG can be generated using Lotus Notes agent.
Create a lotus notes agent (name "svgagent").
Sub Initialize
Print |Content-type:image/svg+xml|
Print |<?xml version="1.0"?>|
Print |<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">|
Print |<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">|
Print |<desc>polyline</desc>|
Print |<g>|
Print |<polyline id="lens" points="10,180 40,120 70,140 100,90 130,40 160,100" fill="none" stroke="purple" stroke-width="2"/>|
'processing and draw the graph
Print |</g>|
Print |</svg>|
End Sub
Then in your webpage you can embed the code below.
For Mozilla, Firefox, Netscape
<object type="image/svg+xml" data="svgagent?OpenAgent" width="200" height="200"></object>
For IE
<embed src="svgagent?OpenAgent" width="200" height="200" pluginspage="http://www.adobe.com/svg/viewer/install/"><embed>
You need to install SVG viewer to view the SVG files. You can download one from Adobe SVG viewer. Below is a sample graph.
23 comments:
Hi,
I wrote a similar article on my site. However, it uses a view instead of an agent. Just a different way to accomplish the same thing :-)
Here is the url : http://www.sith.be/sith/home.nsf/PageID/SITH-65DMP5
Hi,
I have developed a script library to simplify the creation of charts using svg. I will happily provide the sample database (which includes the lib) free of charge.
To see it in action :
http://217.204.16.228/svgdemo.nsf/svgDemo/1?EditDocument
Regards
Tim Crannigan
@Tim. Nice. It works on IE but not on Firefox. The Embed tag doesn't work on Firefox. I check for browser, for Mozilla, I use the object tag instead.
btw, where can i download the sample database?
Happy to email it to you - what's your address
Thanks. You can email me - willbeh at gmail.com
These are some great examples. Tim, could you please send me a copy of the database? I'd like to learn (by example) more about this, and hopefully start using it soon.
Thanks *very* much.
Mark
mheich@sprintmail.com
Hi,
I am interested in using the SVG to plot graph with my notes application , and saw this sample :
http://217.204.16.228/svgdemo.nsf/svgDemo/1?EditDocument&force_refresh=%2038961.275150463
but , where and how to download the svgdemo.nsf database sample ?
please help to give a clear direction ....
Thanks very much.....
The database is from Tim. I'm not sure if I can distribute it directly. You could leave your email and I'll forward it to Tim.
Hi Tim,
Appreciate your great charting by using svg ...
Tim, could you please send me a copy of the database? I'd like to learn (by example)and implement in my Notes application .
hopefully can hear from you soon.
Thanks a lot.
my email: banirtown@yahoo.com
Hi, William
Thanks for your reply ...
My email : ephanlc@yahoo.com.sg
Please help to forward to Tim .
Hope to hear from you soon.
Thanks very much.
Hi Tim,
i like this database Tim(http://217.204.16.228/svgdemo.nsf/svgDemo/1?EditDocument).Could you mail me(attitude@yahoo.com.sg) your database please...
Adam
and pls send it to me to.
email: oceanmoon618@hotmail.com
Thanks for sharing
I also would like a copy of the database.
Anthony Miller
amiller@efcocorp.com
Please email it to me
mostely@gmail.com
please email to me: luca@geminiconsulting.net
please send to me too please: luca@geminiconsulting.net
Hi Tim,
i like this database .Could you mail me(akr30212@gmail.com) your database please...
I am unable top see your database kindly mail it to me at suvomoyroy@gmail.com
Hi Tim,
Please mail the sample database to me also - sriman.koduru@gmail.com
Your work is amaizing.
Thanks in Advance
I wish to have a copy to the database too, you're reply will be much appreciated.
morpheus@live.hk
Hi Tim... could you please send me the database where I can refrence the script as I need to build the same for my project. many thanks
my email address is girish.chopra@gmail.com
how to create dynamic svg graphics and connect to the database
how to create dynamic svg graphics and connect to the database
saputra_nopri@yahoo.co.id
Post a Comment