How to create a dynamic SVG graph using a Lotus Notes agent

How to create a dynamic SVG graph using a Lotus Notes agent

Scalable Vector Graphic (SVG) is a language for describing two-dimensional graphics and graphical applications in XML. It can be used to create dynamic graphs for a Web site. You can use the Lotus Notes agent in this tip to generate a dynamic SVG. Take a look at a sample graph on my blog.

  
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 Web page, you can embed the code below. For Firefox and Netscape, use the following:

<object type="image/svg+xml" 
data="svgagent?OpenAgent" 
width="200" height="200">
</object>

For Internet Explorer use this:

<embed src="svgagent?OpenAgent"
 width="200" height="200" pluginspage=
"http://www.adobe.com/svg/viewer/install/">
<embed>

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip library by member William Beh. Please let others know how useful it is via the rating scale below. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.

This was first published in July 2006

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.