JaoudeStudios.com

Open Source is the road ahead!
It is currently Thu Sep 09, 2010 5:01 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: What other simple shapes svg can draw - graph
PostPosted: Wed Jul 09, 2008 8:46 pm 
Offline
Site Admin
User avatar

Joined: Wed Jul 02, 2008 7:54 pm
Posts: 596
Location: Surrey
This graph is not dynamically generated, it is just a static image, however to make it dynamic should not be too difficult.

Code:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<!-- Axis -->
<line x1="5" y1="177" x2="5" y2="50" style="stroke:#f00;stroke-width:2"/>
<line x1="3" y1="174" x2="150" y2="174" style="stroke:#f00;stroke-width:2"/>

<!-- Axis details -->
<line x1="3" y1="170" x2="5" y2="170" style="stroke:#f00;stroke-width:1"/>
<line x1="3" y1="165" x2="5" y2="165" style="stroke:#f00;stroke-width:1"/>
<line x1="3" y1="160" x2="5" y2="160" style="stroke:#f00;stroke-width:1"/>
<line x1="3" y1="155" x2="5" y2="155" style="stroke:#f00;stroke-width:1"/>

<!-- Data -->
<rect x="10" y="70" width="30" height="100" style="fill:#ccc;stroke-width:0; stroke:#000"/>
<rect x="45" y="100" width="30" height="70" style="fill:#333;stroke-width:0; stroke:#000"/>
<rect x="80" y="80" width="30" height="90" style="fill:#999;stroke-width:0; stroke:#000"/>
<rect x="115" y="120" width="30" height="50" style="fill:#666;stroke-width:0; stroke:#000"/>

<!-- Text -->
<text x="5" y="40" style="font-family:arial;font-size:24">Test graph</text>
</svg>

_________________
JaoudeStudios.com :: Eddie Jaoude :: Geek by nature, Linux by choice
Forum JaoudeStudios - php, mysql, xhtml, css, javascript, jquery, svn subversion, linux, lamp, W3C
Online Agile Task board
Open Source is the road ahead!!


Top
 Profile  
 
 Post subject: Re: What other simple shapes svg can draw - graph
PostPosted: Mon Jul 28, 2008 8:06 pm 
Offline
3. Not so new
User avatar

Joined: Thu Jul 03, 2008 9:28 am
Posts: 34
Location: Outer Space
Works well in IE?


Top
 Profile  
 
 Post subject: Re: What other simple shapes svg can draw - graph
PostPosted: Tue Jul 29, 2008 6:44 am 
Offline
Site Admin
User avatar

Joined: Wed Jul 02, 2008 7:54 pm
Posts: 596
Location: Surrey
Nope IE is shit. There is a plugin download to make it work but it is a bit flaky.

What I do is convert it to a gif/jpeg when I need to display it to the browser. But I still store the svg so that I can do anything to it, i.e. zoom, change colours etc.

_________________
JaoudeStudios.com :: Eddie Jaoude :: Geek by nature, Linux by choice
Forum JaoudeStudios - php, mysql, xhtml, css, javascript, jquery, svn subversion, linux, lamp, W3C
Online Agile Task board
Open Source is the road ahead!!


Top
 Profile  
 
 Post subject: Re: What other simple shapes svg can draw - graph
PostPosted: Tue Jul 29, 2008 6:59 am 
Offline
Site Admin
User avatar

Joined: Wed Jul 02, 2008 7:54 pm
Posts: 596
Location: Surrey
This might help...i just posted a class I wrote a few weeks back, that created curved corners from an SVG then converted it to a GIF (can also do a few other things like ZIP it up for download or display GIFs to screen)

http://www.forum.jaoudestudios.com/viewtopic.php?f=13&t=84

_________________
JaoudeStudios.com :: Eddie Jaoude :: Geek by nature, Linux by choice
Forum JaoudeStudios - php, mysql, xhtml, css, javascript, jquery, svn subversion, linux, lamp, W3C
Online Agile Task board
Open Source is the road ahead!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group