SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Thread: Svg

  1. #1
    SitePoint Addict richard_h's Avatar
    Join Date
    May 2002
    Location
    London
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Svg

    Has anyone any idea why the below code isn't doing what it's supposed to?

    The problem is that the rectangles are supposed to animate by growing in size (but they don't!), many thanks.

    <?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
    "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
    <svg width="300px"
    height="300px"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink" >
    <desc>
    opinion poll
    </desc>
    <title>
    opinion poll
    </title>
    <g style="font-family:verdana,arial;">

    <text x="0" y="10" style="font-size:12">stella</text>
    <rect x="100" y="1" width="37.5" height="12" style="fill:red;stroke:#000000;stroke-width:1">
    <animate attributeType="XML" attributeName="width" from="0" to="37.5" durs="2s" fill="freeze"/>
    </rect>

    <text x="0" y="30" style="font-size:12">bud</text>
    <rect x="100" y="21" width="20.8333333333" height="12" style="fill:orange;stroke:#000000;stroke-width:1">
    <animate attributeType="XML" attributeName="width" from="0" to="20.8333333333" durs="2s" fill="freeze"/>
    </rect>

    <text x="0" y="50" style="font-size:12">fosters</text>
    <rect x="100" y="41" width="15.2777777778" height="12" style="fill:green;stroke:#000000;stroke-width:1">
    <animate attributeType="XML" attributeName="width" from="0" to="15.2777777778" durs="2s" fill="freeze"/>
    </rect>

    <text x="0" y="70" style="font-size:12">heineken</text>
    <rect x="100" y="61" width="6.94444444444" height="12" style="fill:purple;stroke:#000000;stroke-width:1">
    <animate attributeType="XML" attributeName="width" from="0" to="6.94444444444" durs="2s" fill="freeze"/>
    </rect>

    <text x="0" y="90" style="font-size:12">guiness</text>
    <rect x="100" y="81" width="119.444444444" height="12" style="fill:blue;stroke:#000000;stroke-width:1">
    <animate attributeType="XML" attributeName="width" from="0" to="119.444444444" durs="2s" fill="freeze"/>
    </rect>

    </g>

    </svg>

  2. #2
    SitePoint Addict richard_h's Avatar
    Join Date
    May 2002
    Location
    London
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dur NOT durs

    you would not believe how long I'd been looking at that code pulling my hair out!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  3. #3
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Simple but effective!
    Was thinking of doing something similar for my site statistics engine.....
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I still havent gotten round to doing that pie chart M@rco. Shame svg isn't supported more widely though

  5. #5
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indeed, but it's only a matter of time - it is sure to gain greater support soon! I believe that special builds of Mozilla already support it natively, so no doubt MS will want to include it in IE 6.5 (or whatever the next revision will be)!!

    Besides, the Adobe plugin download isn't particularly huge, so SVG is usable right now in current browsers, as long as those accessing the site don't mind the one-off download (which depends on what the site's for, who's accessing it, etc. as you know).
    MarcusJT
    - former ASP web developer / former SPF "ASP Guru"
    - *very* old blog with some useful ASP code

    - Please think, Google, and search these forums before posting!

  6. #6
    SitePoint Addict richard_h's Avatar
    Join Date
    May 2002
    Location
    London
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think the whole SVG thing is quite exciting for a developer/ designer, well worth playing around with despite the accessibility issues.

    Depending on what server side language you use there's a PHP class that'll convert SVG to jpeg/png for the non-SVG pluggin browsers.

    Located here:
    http://bitflux.ch/developer/misc/70/

  7. #7
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thx, that'll definately be handy. At least php is ahead, is there something like that for asp?

  8. #8
    SitePoint Addict richard_h's Avatar
    Join Date
    May 2002
    Location
    London
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't do any ASP so I wouldn't know.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •