Advertisement
6_2008-2009 Graphics/ Sound #201645

Scalable Vector Graphics Charts (SVG) with ASP, Version: Beta 1.0

**** UPDATE 4 JANUARY 2003: This code was a very early attempt with vector graphics. If you are interested in creating static chart images "on-the-fly", without the need of a plug-in, I highly recommend investing your time in .NET GDI+. For a sample of GDI+ charts please visit my web site at www.alerme.com. Paul Walchli, paul@alerme.com. **** I originally posted SVG code on 10/12/01 that rendered charts using HTML and VBScript. ** On 1/31/02 I have posted a JavaScript version ... check Java/JavaScript site for code or visit my website at www.alerme.com**. This code creates the charts utilizing ASP by creating the SVG image on the fly and in a "virtual" page. As with the HTML version, this one is also a Beta version. The colors are ugly and the layout is weak. But, on the bright-side, it's functional. I'll post improvements as time allows. To test this code you will need to create a database, table, and three fields. I have included the information from my database in the ReadMe.txt file included in the zip file. If you use the field names above, all you should need to do is change the database name in three files: Default.asp, incBuildPage.asp, and incBuildSVG.asp. If you do a search/replace for "YourDatabaseNameHere" you'll find the line number of where the connection is. If you have any questions, please contact me at paul@alerme.com. Paul

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
Dim XmlDoc As New XmlDocument
    'Write down the XML declaration
    Dim XmlDeclaration As XmlDeclaration = XmlDoc.CreateXmlDeclaration("1.0", "UTF-8", Nothing)
    'Create the root element
    Dim RootNode As XmlElement = XmlDoc.CreateElement("RootNode")
    XmlDoc.InsertBefore(XmlDeclaration, XmlDoc.DocumentElement)
    XmlDoc.AppendChild(RootNode)
    'Create a new <Category> element and add it to the root node
    Dim ParentNode As XmlElement = XmlDoc.CreateElement("Parent")
    'Set attribute name and value!
    ParentNode.SetAttribute("AttributName", "AttributWert")
    XmlDoc.DocumentElement.PrependChild(ParentNode)
    'Create the required nodes
    Dim FirstElement As XmlElement = XmlDoc.CreateElement("FirstElement")
    Dim SecondElement As XmlElement = XmlDoc.CreateElement("SecondElement")
    Dim ThirdElement As XmlElement = XmlDoc.CreateElement("ThirdElement")

    'retrieve the text
    Dim FirstTextElement As XmlText = XmlDoc.CreateTextNode("This is the text from the first element")
    Dim SecondTextElement As XmlText = XmlDoc.CreateTextNode("This is the text from the second element")
    Dim ThirdTextElement As XmlText = XmlDoc.CreateTextNode("This is the text from the third element")
    'append the nodes to the parentNode without the value
    ParentNode.AppendChild(FirstElement)
    ParentNode.AppendChild(SecondElement)
    ParentNode.AppendChild(ThirdElement)
    'save the value of the fields into the nodes
    FirstElement.AppendChild(FirstTextElement)
    SecondElement.AppendChild(SecondTextElement)
    ThirdElement.AppendChild(ThirdTextElement)
    'Save to the XML file
    XmlDoc.Save("demo.xml")
Original Comments (3)
Recovered from Wayback Machine