[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] SVG - positionering af elementer



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Larsen wrote:
> Hej
> 
> Jeg skal til at lege lidt med noget SVG til at visualisere nogle data, men jeg kan ikke helt finde ud af at positionere elementerne.
> 
> Jeg vil have noget tekst i venstre side, og til højre for den bredeste tekststreng, skal der være nogle bokse (horizontal graf).
> Følgende illustrerer, hvad jeg mener:
> 
> <?xml version="1.0" encoding="utf-8"?>
> 
> <svg  xmlns="http://www.w3.org/2000/svg";
>       xmlns:xlink="http://www.w3.org/1999/xlink";>
>     <text x="5" y="30" font-family="Verdana" font-size="30">Hello, World!</text>
>     <rect x="200" y="3" width="200" height="30" style="fill: #00ff00"/>
> 
>     <text x="5" y="65" font-family="Verdana" font-size="30">Noget tekst</text>
>     <rect x="200" y="38" width="150" height="30" style="fill: #00ff00"/>
> </svg>
> 
> 
> Nu har jeg så hardkodet rektanglernes X koordinat, men kan man ikke gøre noget smartere ? For jeg ved reelt ikke, hvor bred den bredeste streng bliver, når den er renderet.
> 
> Skal man ud i at embedde scripts i SVG'en ?
> 
> På forhånd tak,
> Robert
> 
http://www.mail-archive.com/sslug@sslug/msg12272.html
har noget om dynamisk beregnet længde af tekst

/Niels


- --
Niels Muller Larsen, MSc
Programmer, Teacher

Mob: +45 2040 5740
Web: http://x15.dk
Mail: sslug@sslug
Public key: 0xD4DB4A5E
(http://keyserver.veridis.com:11371/search?q=0xD4DB4A5E)

It's no use crying over spilt milk -- it only makes it salty for the cat.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKQKbgbiU629TbSl4RAsPSAJ9d6Dt0jgm5bbc0DZ5lLUeks/VWTACdEUZu
03YlDqQc6TfAMgtiZE8wCBs=
=vdA9
-----END PGP SIGNATURE-----


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2009-07-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *