Loading ...
Sorry, an error occurred while loading the content.

Re: [svg-developers] Re: Generating SVG on the fly with ASP

Expand Messages
  • Don XML
    Arno, I ll send you the element behavior in a separate email, but to use it you will have to make a couple changes to your design. -- The element behavior is
    Message 1 of 11 , Mar 6, 2001
    • 0 Attachment
      Arno,

      I'll send you the element behavior in a separate email, but to use it you
      will have to make a couple changes to your design.

      -- The element behavior is the standard template for the graph, so you won't
      need to do that.
      -- Query the DB and convert to XML, just as planned.
      -- Write an XSLT to convert the DB XML to the element behavior namespace.
      You can do this either on the server in ASP, or on the client. Since my
      page requires the latest MS XML parser, I let the client do it. Another
      reason was to send the data up to the client once, and use XSLTs to display
      it many ways (i.e. as a table or graph, filter, etc.) Since I wanted to use
      the W3C version of XSLT, I had to require the latest parser, not the one
      installed with IE 5.X.


      Don XML

      ----Original Message Follows----
      From: a.flapper@...
      Reply-To: svg-developers@yahoogroups.com
      To: svg-developers@yahoogroups.com
      Subject: [svg-developers] Re: Generating SVG on the fly with ASP
      Date: Tue, 06 Mar 2001 11:37:38 -0000

      Don,

      I liked the long answer best. I was trying to get it done in ASP as
      follows:
      - Make a standard template for the graph in SVG
      - Query the DB with ASP and retrieve the data as XML
      - Add XSL-code to the SVG-file and make a query to get the correct
      data in the right place.

      The only trouble I got was that I want to control the height and Y-
      coordinates of the rectangles I'm creating.

      I cannot find the correct code for doing this.

      If you can, please send me the Bar behavior. I wanted to include the
      SVG-file I have so, but I cannot find the spot where to do this.

      Greets,

      Arno



      _________________________________________________________________
      Get your FREE download of MSN Explorer at http://explorer.msn.com
    • Michael Bierman
      For those who might be interested in an off the shelf solution, see www.corda.com/svg. ............................... Michael Bierman Senior Product Manager,
      Message 2 of 11 , Mar 6, 2001
      • 0 Attachment

        For those who might be interested in an off the shelf solution, see www.corda.com/svg.

        ...............................
        Michael Bierman
        Senior Product Manager, SVG Product Marketing

        mbierman@...  http://www.adobe.com/svg

        Adobe Systems - "Inspiration becomes reality."


        345 Park Avenue
        San Jose, California 95110



        >
        -----Original Message-----
        > From: Frédéric G. MARAND [
        href="mailto:fgm@...">mailto:fgm@...]
        > Sent: Tuesday,
        March 06, 2001 3:56 AM
        > To: svg-developers@yahoogroups.com
        >
        Subject: Re: [svg-developers] Generating SVG on the fly with ASP
        >
        >
        > In such cases, it seems your best bet is to have
        your ASP code work in two
        > parts:
        > - create the SVG file on its
        own using the FileSystemObject methods,
        > - generate the wrapper HTML
        linking to the just created SVG object.
        >
        > Obviously, in such
        cases, you might want to do some automatic cleanup on
        > generated SVG
        files, probably based on timestamp checking.
        >
        >
        ------------
        > I'm trying out SVG to make a line/bar-graph. It works as a
        static
        > image, but I want to make it dynamic. I want to use ASP as the
        query
        > language to the database, and I want to generate an SVG file as
        the
        > output. Normally I would include a loop in my ASP code to
        generate
        > VML-code.
        >
        > Unfortunately, SVG must be
        standalone. I cannot script anything in
        > the SVG-file.
        >
        >
        Does anyone know how this is done? Is it possible to include svg in a
        >
        normal HTML (so not as an embedded source, but as code)?
        >
        >
        Arno
        >
        >
        >
        >
        > ------------------------ Yahoo!
        Groups Sponsor ---------------------~-~>
        > Find software faster. Search
        more than 20,000
        > software solutions on KnowledgeStorm. Register
        >
        now and get started.
        >
        href="http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/1n6YlB/TM" target=_blank>http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/1n6YlB/TM
        >
        ---------------------------------------------------------------------_->
        >

        >
        >
        Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
      • a.flapper@pecoma.nl
        Michael and all others. Thanks for all the info you sent me. I solved the problem using the FileSystemObject as suggested earlier. This way I do not give away
        Message 3 of 11 , Mar 7, 2001
        • 0 Attachment
          Michael and all others.

          Thanks for all the info you sent me. I solved the problem using the
          FileSystemObject as suggested earlier. This way I do not give away
          too much info about our systems/database.

          I included the code below (if it fails I will add it to the files-
          dir). I use the function ShowChart with an array of values. These
          values I retrieve from an DLL, but here they are hardcoded in the
          graph.

          I know there is some extensive/obsolete coding at some places
          (especially the x-axis break) but I'm still learning SVG. Also sorry
          for some of the Dutch comments in the file.

          I hope this helps others having the same problem.

          Arno
          ________________________

          <%@ Language=VBScript %>
          <%Response.Buffer =False %>
          <%

          '**********************************************************
          ' In this file we make a SVG-file to produce the VS-Graph.
          ' The ShowChart-function is used to produce an array
          ' of values used to produce the graph
          ' The labels are fixed (4 to 16)
          '
          ' Made by Arno Flapper
          ' 05-03-2001
          ' Copyright Pecoma Eindhoven B.V. 2001
          '**********************************************************





          Sub ShowChart(ByRef aValues, ByRef bValues, ByRef cValues, Byref
          dValues, ByRef aLabels, varKopen, perctKopen, varVerkopen,
          perctVerkopen, varKoers, perctKoers)

          Const GRAPH_WIDTH = 300 ' The width of the body of the graph
          Const GRAPH_HEIGHT = 200 ' The heigth of the body of the
          graph
          'Const GRAPH_BORDER = 2 ' The size of the black border
          'Const GRAPH_SPACER = 1 ' The size of the space between
          the bars
          'Const DIV_WIDTH = 400
          ' Declare our variables
          Dim I
          Dim iMaxValue
          Dim aBarHeight
          Dim eValues()
          Dim intCount
          Dim strArray

          ' Get the maximum value in the data set
          iMaxValue = 0
          strArray = ""

          For I = 0 To Ubound(aValues)
          strArray = int(aValues(I)+bValues(I)+cValues(I))
          'Response.Write I & "<br>"
          'Response.write strArray & "<br>"
          Redim preserve eValues(I)
          eValues(I) = strArray
          Next


          For I = 0 To UBound(eValues)
          If iMaxValue < eValues(I) Then iMaxValue = eValues(I)
          Next 'I
          'Response.Write iMaxValue ' Debugging line


          '**********************************************************
          ' Start drawing the graph
          '
          ' In this part the basis is laid for the graph
          ' Due to the nature of the SVG-file, we must declare the
          ' elements we want to show first, at the beginning of the file.
          '
          ' Arno Flapper
          '**********************************************************
          strSVG = "<?xml version=" & chr(34) & "1.0" & chr(34) & "
          standalone=" & chr(34) & "no" & chr(34) & "?>" & vbCrLf & vbCrLF
          strSVG = strSVG & "<!DOCTYPE svg SYSTEM " & chr(34) & "svg-
          19991203.dtd" & chr(34) & " >" & vbCrLf
          strSVG = strSVG & "<svg width=" & chr(34) & "500" & chr(34) & "
          height=" & chr(34) & "500" & chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<desc>De Van Slingerlandt-Grafiek</desc>" & vbCrLf

          '**********************************************************
          ' Filters
          '**********************************************************
          strSVG = strSVG & "<filter id=" & chr(34) & "dropshadow" & chr(34)
          & ">" & vbCrLf
          strSVG = strSVG & "<feGaussianBlur in=" & chr(34) & "SourceAlpha" &
          chr(34) & " stdDeviation=" & chr(34) & "3" & chr(34) & " result=" &
          chr(34) & "blur" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & " <feOffset in=" & chr(34) & "blur" & chr(34)
          & " dx=" & chr(34) & "4" & chr(34) & " dy=" & chr(34) & "4" & chr(34)
          & " result=" & chr(34) & "offsetBlur" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<feMerge>" & vbCrLf
          strSVG = strSVG & "<feMergeNode in=" & chr(34) & "offsetBlur" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<feMergeNode in=" & chr(34) & "SourceGraphic" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "</feMerge>" & vbCrLf
          strSVG = strSVG & "</filter>" & vbCrLf

          '**********************************************************
          ' Fill gradient
          '**********************************************************
          strSVG = strSVG & "<!-- A-Gradient -->" & vbCrLf
          strSVG = strSVG & "<radialGradient id=" & chr(34) & "A_Gradient" & chr
          (34) & " gradientUnits=" & chr(34) & "objectBoundingBox" & chr(34)
          & " cx=" & chr(34) & "0" & chr(34) & " cy=" & chr(34) & "0" & chr(34)
          & " r=" & chr(34) & "1.2" & chr(34) & " >" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "0%" & chr(34) & "
          style=" & chr(34) & "stop-color:white" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "60%" & chr(34) & "
          style=" & chr(34) & "stop-color:rgb(181, 181, 230)" & chr(34) & "/>"
          & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "80%" & chr(34) & "
          style=" & chr(34) & "stop-color:rgb(102, 102, 153)" & chr(34) & "/>"
          & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "100%" & chr(34) & "
          style=" & chr(34) & "stop-color:rgb(22, 22, 73)" & chr(34) & " />" &
          vbCrLf
          strSVG = strSVG & "</radialGradient>" & vbCrLf
          strSVG = strSVG & "!-- B-Gradient -->" & vbCrLf
          strSVG = strSVG & "<radialGradient id=" & chr(34) & "B_Gradient" & chr
          (34) & " gradientUnits=" & chr(34) & "objectBoundingBox" & chr(34)
          & " cx=" & chr(34) & "0" & chr(34) & " cy=" & chr(34) & "0" & chr(34)
          & " r=" & chr(34) & "1.2" & chr(34) & " >" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "0%" & chr(34) & "
          style=" & chr(34) & "stop-color:teal" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "100%" & chr(34) & "
          style=" & chr(34) & "stop-color:yellow" & chr(34) & " />" & vbCrLf
          strSVG = strSVG & "</radialGradient>" & vbCrLf
          strSVG = strSVG & "<!-- C-Gradient -->" & vbCrLf
          strSVG = strSVG & "<radialGradient id=" & chr(34) & "C_Gradient" & chr
          (34) & " gradientUnits=" & chr(34) & "objectBoundingBox" & chr(34)
          & " cx=" & chr(34) & "0" & chr(34) & " cy=" & chr(34) & "0" & chr(34)
          & " r=" & chr(34) & "1.2" & chr(34) & " >" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "0%" & chr(34) & "
          style=" & chr(34) & "stop-color:yellow" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "60%" & chr(34) & "
          style=" & chr(34) & "stop-color:orange" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<stop offset=" & chr(34) & "100%" & chr(34) & "
          style=" & chr(34) & "stop-color:red" & chr(34) & " />" & vbCrLf
          strSVG = strSVG & "</radialGradient>" & vbCrLf

          '**********************************************************
          ' X- and Y-labels
          '
          ' The labels are fixed in this file.
          ' They could be made dynamic by using the label array.
          '**********************************************************
          strSVG = strSVG & "<g id=" & chr(34) & "graph_frame" & chr(34) & "
          width=" & chr(34) & "500" & chr(34) & " height=" & chr(34) & "500" &
          chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<g id=" & chr(34) & "labels" & chr(34) & ">" &
          vbCrLf
          strSVG = strSVG & "<text style=" & chr(34) & "font-family:Verdana;
          font-size:10pt; fill:blue" & chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<textPath xlink:href=" & chr(34) & "#y_axis" & chr
          (34) & ">" & vbCrLf
          strSVG = strSVG & "<tspan dy=" & chr(34) & "30" & chr(34) & " dx=" &
          chr(34) & "25" & chr(34) & ">Waarde</tspan>" & vbCrLf
          strSVG = strSVG & "</textPath>" & vbCrLf
          strSVG = strSVG & "</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "175" & chr(34) & " y=" & chr
          (34) & "290" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:10pt; fill:blue" & chr(34) & ">Jaren</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "65" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">4</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "88" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">5</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "110" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">6</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "133" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">7</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "155" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">8</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "177" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">9</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "195" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">10</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "217" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">11</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "239" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">12</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "262" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">13</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "283" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">14</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "305" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">15</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "327" & chr(34) & " y=" & chr
          (34) & "260" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">16</text>" & vbCrLf
          strSVG = strSVG & "<text x=" & chr(34) & "35" & chr(34) & " y=" & chr
          (34) & "255" & chr(34) & " style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">0</text>" & vbCrLf
          strSVG = strSVG & "</g>" & vbCrLf


          '**********************************************************
          ' Calculate the height of the different elements
          '**********************************************************
          Dim bBarHeight, cBarHeight, dBarHeight, varLeft, varTop
          Dim kopenHeight,verkopenHeight, koersHeight, iBarWidth
          Dim labelValue, varOpacity
          varOpacity = ""
          varLeft=60
          iBarWidth=22

          For I = 0 To UBound(eValues)
          varTop=250
          aBarHeight = Int((aValues(I) / iMaxValue) * GRAPH_HEIGHT)
          bBarHeight = Int((bValues(I) / iMaxValue) * GRAPH_HEIGHT)
          cBarHeight = Int((cValues(I) / iMaxValue) * GRAPH_HEIGHT)
          labelValue = Int(aLabels(I))

          if I = 6 then
          varOpacity = "1"
          else
          varOpacity = ".2"
          end if

          strSVG = strSVG & "<g id=" & chr(34) & "year_" & labelValue & chr(34)
          & ">" & vbCrLf
          strSVG = strSVG & "<rect x=" & chr(34) & varLeft & chr(34) & " y=" &
          chr(34) & varTop & chr(34) & " width=" & chr(34) & "22" & chr(34) & "
          height=" & chr(34) & -(aBarHeight) & chr(34) & " style=" & chr(34)
          & "fill:url(#A_Gradient);stroke:black;opacity:" & varOpacity & chr
          (34) & "/>" & vbCrLf
          varTop = VarTop - aBarHeight
          strSVG = strSVG & "<rect x=" & chr(34) & varLeft & chr(34) & " y=" &
          chr(34) & varTop & chr(34) & " width=" & chr(34) & "22" & chr(34) & "
          height=" & chr(34) & -(bBarHeight) & chr(34) & " style=" & chr(34)
          & "fill:url(#B_Gradient);stroke:black;opacity:" & varOpacity & chr
          (34) & "/>" & vbCrLf
          varTop = VarTop - bBarHeight
          strSVG = strSVG & "<rect x=" & chr(34) & varLeft & chr(34) & " y=" &
          chr(34) & varTop & chr(34) & " width=" & chr(34) & "22" & chr(34) & "
          height=" & chr(34) & -(cBarHeight) & chr(34) & " style=" & chr(34)
          & "fill:url(#C_Gradient);stroke:black;opacity:" & varOpacity & chr
          (34) & "/>" & vbCrLf
          varTop = VarTop - cBarHeight
          strSVG = strSVG & "<rect x=" & chr(34) & varLeft & chr(34) & " y=" &
          chr(34) & varTop & chr(34) & " width=" & chr(34) & "22" & chr(34) & "
          height=" & chr(34) & -(dBarHeight) & chr(34) & " style=" & chr(34)
          & "fill:url(#A_Gradient);stroke:black;opacity:" & varOpacity & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "</g>" & vbCrLf

          varLeft = varLeft + iBarWidth
          Next


          '**********************************************************
          ' Building the axis
          '
          '
          '
          '**********************************************************
          strSVG = strSVG & "<g id=" & chr(34) & "axis" & chr(34) & " style="
          & chr(34) & "fill:#000000;stroke:#000000;filter:url(#dropshadow)" &
          chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<g id=" & chr(34) & "x_break" & chr(34) & ">" &
          vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 250 L 52 250" & chr
          (34) & " style=" & chr(34) & "stroke:black;stroke-width:1px;" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 52 250 L 54 255" & chr
          (34) & " style=" & chr(34) & "stroke:black;stroke-width:1px;" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 54 255 L 56 245" & chr
          (34) & " style=" & chr(34) & "stroke:black;stroke-width:1px;" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 56 245 L 58 250" & chr
          (34) & " style=" & chr(34) & "stroke:black;stroke-width:1px;" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 58 250 L 60 250" & chr
          (34) & " style=" & chr(34) & "stroke:black;stroke-width:1px;" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "</g>" & vbCrLf

          strSVG = strSVG & "<path id=" & chr(34) & "Y_axis" & chr(34) & " d="
          & chr(34) & "M 50 250 L 50 35" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<path id=" & chr(34) & "x_axis" & chr(34) & " d="
          & chr(34) & "M 60 250 L 360 250" & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 35 L 55 40" & chr(34)
          & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 35 L 45 40" & chr(34)
          & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 250 L 46 250" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 225 L 46 225" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 200 L 46 200" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 175 L 46 175" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 150 L 46 150" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 125 L 46 125" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 100 L 46 100" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 75 L 46 75" & chr(34)
          & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 50 50 L 46 50" & chr(34)
          & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 360 250 L 355 245" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "<path d=" & chr(34) & "M 360 250 L 355 255" & chr
          (34) & "/>" & vbCrLf
          strSVG = strSVG & "</g>" & vbCrLf


          '**********************************************************
          ' Start of the extra lines
          ' These values are calculated by with the max height
          ' value
          '
          '
          '**********************************************************
          Dim waardeKopen, waardeVerkopen, waardeKoers
          varTop=250
          waardeKopen = Int((varKopen / iMaxValue) * GRAPH_HEIGHT)
          waardeVerkopen = Int((eValues(6) / iMaxValue) * GRAPH_HEIGHT)
          waardeKoers = Int((varKoers / iMaxValue) * GRAPH_HEIGHT)

          '**********************************************************
          ' Building the buyline
          '**********************************************************
          strSVG = strSVG & "<g id=" & chr(34) & "value_lines" & chr(34) & ">"
          & vbCrLf
          strSVG = strSVG & "<path id=" & chr(34) & "buy_line" & chr(34) & "
          d=" & chr(34) & "M 50 " & varTop-waardeKopen & " L 355 " & varTop-
          waardeKopen & chr(34) & " style=" & chr(34) & "stroke:blue;stroke-
          width:1px;stroke-dasharray: 3; " & chr(34) & "/>" & vbCrLf
          strSVG = strSVG & "<path id=" & chr(34) & "buy_line2" & chr(34) & "
          d=" & chr(34) & "M 25 " & varTop-waardeKopen & " L 400 " & varTop-
          waardeKopen & chr(34) & " style=" & chr(34) & "visibility: hidden;" &
          chr(34) & " />" & vbCrLf
          strSVG = strSVG & "<text style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<textPath xlink:href=" & chr(34) & "#buy_line2" &
          chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<tspan dy=" & chr(34) & "5" & chr(34) & " >" &
          varKopen & "</tspan>" & vbCrLf
          strSVG = strSVG & "<tspan dx=" & chr(34) & "315" & chr(34) & ">" &
          perctKopen & "%</tspan>" & vbCrLf
          strSVG = strSVG & "</textPath>" & vbCrLf
          strSVG = strSVG & "</text>" & vbCrLf


          '**********************************************************
          ' Building the sellline
          '**********************************************************
          strSVG = strSVG & "<path id=" & chr(34) & "sell_line" & chr(34) & "
          d=" & chr(34) & "M 50 " & varTop-waardeverkopen & " L 355 " &
          varTop-waardeVerkopen & chr(34) & " style=" & chr(34)
          & "stroke:red;stroke-width:1px;stroke-dasharray: 3;" & chr(34) & "/>"
          & vbCrLf
          strSVG = strSVG & "<path id=" & chr(34) & "sell_line2" & chr(34) & "
          d=" & chr(34) & "M 25 " & varTop-waardeverKopen & " L 400 " & varTop-
          waardeVerkopen & chr(34) & " style=" & chr(34) & "visibility:
          hidden;" & chr(34) & " />" & vbCrLf
          strSVG = strSVG & "<text style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<textPath xlink:href=" & chr(34) & "#sell_line2" &
          chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<tspan dy=" & chr(34) & "5" & chr(34) & " >" &
          eValues(6) & "</tspan>" & vbCrLf
          strSVG = strSVG & "<tspan dx=" & chr(34) & "320" & chr(34) & ">" &
          perctVerkopen & "%</tspan>" & vbCrLf
          strSVG = strSVG & "</textPath>" & vbCrLf
          strSVG = strSVG & "</text>" & vbCrLf


          '**********************************************************
          ' Building the buyline
          '**********************************************************
          strSVG = strSVG & "<path id=" & chr(34) & "current_line" & chr(34)
          & " d=" & chr(34) & "M 50 " & varTop-waardeKoers & " L 355 " &
          varTop-waardeKoers & chr(34) & " style=" & chr(34)
          & "stroke:black;stroke-width:1px;stroke-dasharray: 3;" & chr(34)
          & "/>" & vbCrLf
          strSVG = strSVG & "<path id=" & chr(34) & "current_line2" & chr(34)
          & " d=" & chr(34) & "M 25 " & varTop-waardeKoers & " L 400 " &
          varTop-waardeKoers & chr(34) & " style=" & chr(34) & "visibility:
          hidden;" & chr(34) & " />" & vbCrLf
          strSVG = strSVG & "<text style=" & chr(34) & "font-family:Verdana;
          font-size:8pt; fill:black" & chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<textPath xlink:href=" & chr(34)
          & "#current_line2" & chr(34) & ">" & vbCrLf
          strSVG = strSVG & "<tspan dy=" & chr(34) & "5" & chr(34) & " >" &
          varKoers & " </tspan>" & vbCrLf
          strSVG = strSVG & "<tspan dx=" & chr(34) & "330" & chr(34) & ">" &
          perctKoers & "%</tspan>" & vbCrLf
          strSVG = strSVG & "</textPath>" & vbCrLf
          strSVG = strSVG & "</text>" & vbCrLf


          strSVG = strSVG & "</g>" & vbCrLf

          strSVG = strSVG & "</g>" & vbCrLf
          strSVG = strSVG & "</svg>" & vbCrLf


          ' Hier wordt het daadwerkelijke bestand uitgevoerd.
          Dim fso, f, ts,strSVG, SVGFileName
          Application("SVG_File_Counter") = Cstr(Cint(Application
          ("SVG_File_Counter"))+1)

          'Set Application("SVG_File_Counter") = Application.Contents
          ("SVG_File_Counter") + 1
          Set fso = CreateObject("Scripting.FileSystemObject")
          fso.CreateTextFile Server.MapPath("SVG/" & Application
          ("SVG_File_Counter") & ".svg") 'Create a file
          Set f = fso.GetFile(Server.MapPath("SVG/" & Application
          ("SVG_File_Counter") & ".svg"))
          Set ts = f.OpenAsTextStream(2, -2)
          ts.Write strSVG
          ts.Close
          'Response.Write strSVG

          End Sub


          ShowChart Array(1, 10, 12, 18, 20, 26, 27, 28, 30, 34, 37, 45, 55),
          Array(1, 10, 12, 18, 23, 26, 27, 28, 30, 34, 37, 45, 55), Array(1,
          10, 12, 18, 23, 26, 27, 28, 30, 34, 37, 45, 55),Array
          ("0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0"),
          Array
          ("4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16
          "), 20, 9, 30, 15, 30, 12

          %>
          <html>

          <head>
          <meta http-equiv="content-type"
          content="text/html;charset=iso-8859-1">
          <title>van Slingerlandt -- Grafiek</title>

          </head>

          <body bgcolor="#f0f0f0">
          <embed NAME="grafiek" height="500" width="500"
          src="SVG/<%= Application("SVG_File_Counter") %>.svg">
          </body>


          </html>
        • Michael Bierman
          Yes, this is possible with the Adobe Viewer. See the IE 5.5 Behaviors discussion that took place earlier and some sample files from Peter. Below is a short
          Message 4 of 11 , Mar 7, 2001
          • 0 Attachment

            Yes, this is possible with the Adobe Viewer. See the "IE 5.5 Behaviors" discussion that took place earlier and some sample files from Peter. Below is a short code fragment (I don't know if I have to do anything special for code to remain viewable on yahoogroups, so if it doesn't appear, go to the "Files" area and see yourself. )

            <?IMPORT namespace="svg" implementation="svg.htc">
            <HTML>
            <HEAD>
            <TITLE>TEST</TITLE>
            </HEAD>
            <BODY BGCOLOR="#DDDDDD">
            <H1>Embedded SVG Example</H1>
            <svg:svg width="500" height="300">
            <svg:defs>
            <svg:filter id="Filter_Bumps" x="-10%" y="-35%" width="120%" height="170%" filterUnits="objectBoundingBox">
             <svg:feTurbulence baseFrequency="0.2" numOctaves="10" result="turb"/>
             <svg:feMorphology in="SourceGraphic" radius="2" operator="dilate" result="fatSource"/>
             <svg:feMorphology in="SourceAlpha" radius="2" operator="dilate" result="fatAlpha"/>
             <svg:feGaussianBlur in="fatAlpha" stdDeviation="4" result="blurredFatAlpha"/>
             <svg:feOffset in="blurredFatAlpha" dx="5" dy="5" result="offsetBlurredAlpha"/>
             <svg:feGaussianBlur in="SourceAlpha" stdDeviation="2" result="blur"/>
             <svg:feComposite in="blur" in2="turb" operator="arithmetic" k1="0.6" k2="0.4" k3="0" k4="0" result="bumpMap"/>
             <svg:feSpecularLighting in="bumpMap" specularConstant="1" specularExponent="10" surfaceScale="5" lightColor="white" result="specularOut">
              <svg:fePointLight x="-5000" y="-10000" z="20000"/>
             </svg:feSpecularLighting>
             <svg:feComposite in="fatSource" in2="specularOut" operator="arithmetic" k1="1" k2="0.8" k3="0.8" k4="0" result="litPaint"/>
             <svg:feComposite in="litPaint" in2="fatAlpha" operator="in" result="bumpy"/>
             <svg:feMerge>
              <svg:feMergeNode in="offsetBlurredAlpha"/>
              <svg:feMergeNode in="bumpy"/>
             </svg:feMerge>
            </svg:filter>
            <svg:filter id="Filter_3D_Shadow" x="-10%" y="-35%" width="120%" height="170%" filterUnits="objectBoundingBox">

            ...

             

            You will need IE 5.5 to see it all view correctly but I've attached some PNGs to show those who are not "5.5" enabled what it looks like.

            ...............................
            Michael Bierman
            Senior Product Manager, SVG Product Marketing
            mbierman@...  http://www.adobe.com/svg

            Adobe Systems - "Inspiration becomes reality."
            345 Park Avenue
            San Jose, California 95110




            > -----Original Message-----

            > From:
            smaher@... [mailto:smaher@...]
            > Sent: Monday,
            March 05, 2001 8:04 AM
            > To: svg-developers@yahoogroups.com
            >
            Subject: [svg-developers] Re: Generating SVG on the fly with ASP
            >
            >
            > Hi -
            >
            > Two ideas:
            >
            > 1)
            Switch to a servlet instead - that's what we've done.
            >
            > We have an
            html document with an <EMBED ... src=ourservlet ...>. 
            >
            Ourservlet generates svg from database queries.  There is javascript
            > in the html document that allows interaction with the svg
            elements.
            >
            > 2) Try <EMBED ... src=svg.jsp> and put the
            jsp-DB stuff in the svg
            > file(??)  I'm not sure this will work
            ...
            >
            > Steve
            >
            >
            > --- In svg-developers@y...,
            Jiri Jirat <Jiri.Jirat@i...> wrote:
            > > Hello,
            > > 
            Amaya (W3C browser,
            http://www.w3c.org/Amaya) is able to display
            > > SVG which is included directly in HTML code. But I
            haven't succeeded
            > > in doing this with Adobe plug-in.
            > > I
            don't know exactly, what the browser "shall/should/must"?
            > >
            > > I am also very interested, whether it is possible with IE or
            >
            Netscape
            > > with Adobe plug-in. Is there anybody who knows
            that?
            > >
            > > Regards
            > > Jirka
            > >
            > > a.flapper@p... wrote:
            > > >
            > > > Hi Guys,
            > > >
            > > > I'm trying out SVG to make a line/bar-graph. It
            works as a static
            > > > image, but I want to make it dynamic. I want
            to use ASP as the
            > query
            > > > language to the database, and
            I want to generate an SVG file as
            > the
            > > > output. Normally
            I would include a loop in my ASP code to generate
            > > >
            VML-code.
            > > >
            > > > Unfortunately, SVG must be
            standalone. I cannot script anything in
            > > > the SVG-file.
            > > >
            > > > Does anyone know how this is done? Is it possible to
            include svg
            > in a
            > > > normal HTML (so not as an embedded
            source, but as code)?
            > > >
            > > > Arno
            > > >
            > > >
            > > >
            > > >
            > > >
            Your use of Yahoo! Groups is subject to
            >
            href="http://docs.yahoo.com/info/terms/" target=_blank>http://docs.yahoo.com/info/terms/
            >
            >
            > > --
            > >  <name firstName="Jirka"
            surname="Jirat"/>
            > >  <mail>    
            jiratj@i...  </mail>
            > >  <support> 
            http://www.zvon.org </support>
            > >  <zvonMailingList>
            href="http://www.zvon.org/index.php?nav_id=4" target=_blank>http://www.zvon.org/index.php?nav_id=4
            >
            > </zvonMailingList>
            >
            >
            > ------------------------
            Yahoo! Groups Sponsor ---------------------~-~>
            > Find software faster.
            Search more than 20,000
            > software solutions on KnowledgeStorm.
            Register
            > now and get started.
            >
            href="http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/1n6YlB/TM" target=_blank>http://us.click.yahoo.com/ee3V2C/RNSCAA/2h4EAA/1n6YlB/TM
            > ---------------------------------------------------------------------_->
            >

            >
            >
            Your use of Yahoo! Groups is subject to
            http://docs.yahoo.com/info/terms/
            >
            >

          • Don XML
            Arno, If you want to code it right, use the XML DOM, not strings. The MS XML DOM has some cool extensions to the W3C standard that allow you to save the XML
            Message 5 of 11 , Mar 7, 2001
            • 0 Attachment
              Arno,

              If you want to code it right, use the XML DOM, not strings. The MS XML DOM
              has some cool extensions to the W3C standard that allow you to save the XML
              to a file, so you don't even need to use the FSO. Remember, SVG is just XML
              of a specific namespace (well truthfully the SVG docs can contain other
              namespaces, like xlink). Any XML Parser can read or create a SVG doc, they
              just can't "display" it like the viewer does.

              Don XML


              ----Original Message Follows----
              From: a.flapper@...
              Reply-To: svg-developers@yahoogroups.com
              To: svg-developers@yahoogroups.com
              Subject: [svg-developers] Re: Generating SVG on the fly with ASP
              Date: Wed, 07 Mar 2001 10:16:09 -0000

              Michael and all others.

              Thanks for all the info you sent me. I solved the problem using the
              FileSystemObject as suggested earlier. This way I do not give away
              too much info about our systems/database.

              I included the code below (if it fails I will add it to the files-
              dir). I use the function ShowChart with an array of values. These
              values I retrieve from an DLL, but here they are hardcoded in the
              graph.

              I know there is some extensive/obsolete coding at some places
              (especially the x-axis break) but I'm still learning SVG. Also sorry
              for some of the Dutch comments in the file.

              I hope this helps others having the same problem.

              Arno
              ________________________

              _________________________________________________________________
              Get your FREE download of MSN Explorer at http://explorer.msn.com
            Your message has been successfully submitted and would be delivered to recipients shortly.