<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet href="xslt/copy.xsl" type="text/xsl"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:tb="http://www.treebuilder.de/namespace">
	<head>
		<title>Treebuilder:: a dynamic coin stack chart</title>
		<meta name="keywords" content="svg,xslt,charts,barchart,coins,coinstack chart,stack"/>
		<link rel="alternate" type="application/rss+xml" href="rss.asp" title="Treebuilder-News"/>
		<link rel="Stylesheet" type="text/css" href="css/kp1.css" title="treebuilder"/>
		<style type="text/css">
	  	body {font-family:sans-serif;font-size:0.9em;margin:0px;padding:0px;background:royalblue;color:#555}
		a:link {text-decoration:underline;color:royalblue}
		a:visited {text-decoration:underline;color:royalblue}
		a:hover {text-decoration:underline;color:blue}
		h1 {font-size:1.2em;color:blue;padding:0px;}
		h2 {font-size:0.9em;color:blue;padding-top:0px;font-weight:normal}
		td {text-align:left}
	  </style>
	</head>
	<body>
		<script type="text/javascript">
		function show()
			{
				var title=document.getElementById("select1").value
				var l=document.getElementsByTagName("link")
				for (var pi=0; pi != l.length;pi++)
					{
						if(l.item(pi).title==title)
							{
								l.item(pi).disabled=false
							}else
							{
								l.item(pi).disabled=true
							}
					}
			}
	</script>
		<center>
			<div style="width:75%">
				<table cellspacing="0" cellpadding="0" border="0" style="width:100%;height:79px;margin-top:20px">
					<tr>
						<td style="width:20px;background-image:url(images/layout/bpat_t_l1.png)"></td>
						<td style="background-image:url(images/layout/bpat_t_m1.png)">
							<table>
								<tr>
									<td style="width:40%"></td>
									<td style="padding:5px 0px 0px 0px">
										<a href="default.asp?file=start.xml" title="Home">
											<img src="../images/logo/tree-logo.png" style="height:60px;border:0px;margin:0px;padding:0px"/>
										</a>
									</td>
									<td style="width:40%;font-size:0.8em;text-align:right;color:#111;vertical-align:bottom">
										<a href="default.asp?file=start.xml" style="font-weight:normal;color:#111;text-decoration:none">Home</a> | <a href="default.asp?file=980999.xml" style="font-weight:normal;color:#111;text-decoration:none">Programming</a> | <a href="default.asp?file=971752.xml" style="font-weight:normal;color:#111;text-decoration:none">Gallery</a> | <a href="default.asp?file=112240.xml" style="font-weight:normal;color:#111;text-decoration:none">Blog</a> | <a href="default.asp?file=871013.xml" style="font-weight:normal;color:#111;text-decoration:none">About</a> | <a href="default.asp?file=131725.xml" style="font-weight:normal;color:#111;text-decoration:none">A-Z</a> | </td>
								</tr>
							</table>
						</td>
						<td style="width:19px;background-image:url(images/layout/bpat_t_r1.png)"></td>
					</tr>
				</table>
				<table cellspacing="0" cellpadding="0" border="0" style="width:100%">
					<tr>
						<td style="width:5px;background-image:url(images/layout/bpat_b_l2.png)"></td>
						<td style="vertical-align:top">
							<table cellspacing="0" cellpadding="0" border="0" style="width:100%;">
								<tr>
									<td colspan="2" style="padding:10px 10px 0px 10px;background-image:url(images/layout/pat_content_links1.png);">
										<div style="font-size:0.8em;margin-bottom:10px;color:#fff;font-weight:bold">
											<a href="default.asp?file=start.xml" style="color:#fff;text-decoration:none;font-weight:normal">Home</a> »
    <a href="default.asp?file=980999.xml" style="color:#fff;text-decoration:none;font-weight:normal">Programming</a> »
    <a href="default.asp?file=250484.xml" style="color:#fff;text-decoration:none;font-weight:normal">XSLT</a> »
    a dynamic coin stack chart</div>
									</td>
								</tr>
								<tr>
									<td style="background-image:url(images/layout/pat_content_links1.png);padding:0px 5px 20px 10px;vertical-align:top">
										<table cellspacing="0" cellpadding="0" border="0" style="width:100%;height:400px">
											<tr>
												<td style="width:20px;background-image:url(images/layout/pat_app_top_links2.png);"></td>
												<td style="background-image:url(images/layout/pat_app_top_mitte2.png)"><div></div></td>
												<td style="width:14px;height:13px;background-image:url(images/layout/pat_app_top_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="background-image:url(images/layout/pat_app_body_links1.png)"></td>
												<td id="contentarea" style="/width:100%;background:#fff;vertical-align:top;padding:20px 10px 20px 10px">
													<div style="font-size:0.7em;color:#555;float:right;margin-top:-20px">
		by Holger | 
		7/23/2006 12:51:42 PM | 
		Keywords: 
		<a href="search2.asp?searchterm=svg">svg</a>,
      <a href="search2.asp?searchterm=xslt">xslt</a>,
      <a href="search2.asp?searchterm=charts">charts</a>,
      <a href="search2.asp?searchterm=barchart">barchart</a>,
      <a href="search2.asp?searchterm=coins">coins</a>,
      <a href="search2.asp?searchterm=coinstack chart">coinstack chart</a>,
      <a href="search2.asp?searchterm=stack">stack</a>
													</div>
													<h1>a dynamic coin stack chart</h1><p>
this coin stack chart is a derivation of  the chart in my <a href="default.asp?file=306286.xml">previous post</a>. i use the same chart syntax, but a different xslt stylesheet. below you can see a png version of that chart , i first transformed it into pure svg with saxon, and then rendered it to png with batik.<br/><br/><img src="xslt1/examples/example15/example15.png" width="400px" height="250px">
														</img>
													</p><p>
here is again an <a href="xslt1/examples/example15/example15.xml" style="">example xhtml</a> file with the chart dynamicly created client side.
one step further would be serving a dynamicly generated document to the client, this is quite simple.
my example .asp page looks like this:
<div style="border:1px solid #aaa;padding:0px 5px 0px 5px;margin:0px 40px 0px 40px;color:#000;overflow:auto;width:500px"><pre>
&lt;%@ Language=VBScript %&gt;&lt;?xml-stylesheet href="extension.xsl" type="text/xsl"?&gt;
&lt;%
response.contentType="text/xml"
Randomize Timer
%&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:tb="http://www.treebuilder.de/namespace"&gt;
  &lt;head&gt;
    &lt;title&gt;test&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;a dynamic coin stack chart&lt;/h1&gt;

&lt;chart xmlns="http://www.treebuilder.de/namespace" width="400" height="250"&gt;
  &lt;nVPair&gt;
    &lt;name&gt;Item 1&lt;/name&gt;
    &lt;value&gt;&lt;%=cint(rnd()*20000)%&gt;&lt;/value&gt;
  &lt;/nVPair&gt;
  &lt;nVPair&gt;
    &lt;name&gt;Item 2&lt;/name&gt;
    &lt;value&gt;&lt;%=cint(rnd()*20000)%&gt;&lt;/value&gt;
  &lt;/nVPair&gt;
  &lt;nVPair&gt;
    &lt;name&gt;Item 3&lt;/name&gt;
    &lt;value&gt;&lt;%=cint(rnd()*20000)%&gt;&lt;/value&gt;
  &lt;/nVPair&gt;
  &lt;nVPair&gt;
    &lt;name&gt;Item 4&lt;/name&gt;
    &lt;value&gt;&lt;%=cint(rnd()*20000)%&gt;&lt;/value&gt;
  &lt;/nVPair&gt;
  &lt;nVPair&gt;
    &lt;name&gt;Item 5&lt;/name&gt;
    &lt;value&gt;&lt;%=cint(rnd()*20000)%&gt;&lt;/value&gt;
  &lt;/nVPair&gt;
&lt;/chart&gt;
&lt;br/&gt;
each time you reload this page, a new random set of values will be created at the server, and a new document is send to the client. it gets transformed by xslt. the xslt is cached, so only downloaded once.
that means that subsequent reloads of the page with different data cost around 0.5K traffic !


  &lt;/body&gt;
&lt;/html&gt;
</pre>
														</div><br/>
here is the <a href="xslt1/examples/example15/example15.asp" style="">dynamicaly generated chart</a>
in action. you can observe the major advantage of using xslt (!) ; this file is only 0.5K
per reload, only the first request will load an 9K stylesheet which will be cached by the browser.
	</p></td>
												<td style="background-image:url(images/layout/pat_app_body_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_links1.png)"></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_mitte1.png)"><div></div></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_rechts1.png)"></td>
											</tr>
										</table>
									</td>
									<td style="width:200px;vertical-align:top;padding:0px 10px 20px 5px;background-image:url(images/layout/pat_content_links1.png)">
										<table cellspacing="0" cellpadding="0" border="0" style="width:100%;font-size:0.8em;margin:0px 0px 5px 0px">
											<tr>
												<td style="width:20px;background-image:url(images/layout/pat_app_top_links2.png);"></td>
												<td style="background-image:url(images/layout/pat_app_top_mitte2.png)"/>
												<td style="width:14px;height:13px;background-image:url(images/layout/pat_app_top_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="background-image:url(images/layout/pat_app_body_links1.png)"></td>
												<td style="background:#fff;vertical-align:top">
													<div class="explorer_punkt" style="font-size:0.9em;border:0px">
														<img src="images/icons/NEUordner_geschlossen.png"/><a href="default.asp?file=980999.xml" style="color:#555">../</a>
													</div>
													<div class="explorer_punkt" style="font-size:0.9em;border:0px">
														<img src="images/icons/NEUordner_geschlossen.png"/><a href="default.asp?file=358730.xml" style="color:#555">SVG</a>
													</div>
													<div class="explorer_punkt" style="font-size:0.9em;border:0px">
														<img src="images/icons/NEUordner_geschlossen.png"/><a href="default.asp?file=137859.xml" style="color:#555">Tools</a>
													</div>
													<div class="explorer_punkt" style="font-size:0.9em;border:0px">
														<img src="images/icons/NEUordner_geschlossen.png"/><a href="default.asp?file=195003.xml" style="color:#555">XUL</a>
													</div>
													<div class="explorer_punkt" style="font-size:0.9em;border:0px">
														<img src="images/icons/NEUordner_geschlossen.png"/><a href="default.asp?file=250484.xml" style="color:#555">XSLT</a>
													</div>
													<div class="explorer_sub">
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=250484.xml" style="color:#555">XSLT </a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=284771.xml" style="color:#555">a simple svg textbox created with xslt</a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=313823.xml" style="color:#555">scriptable progress bar: mixing XHTML,SVG,XSLT,CSS and JavaScript</a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=934978.xml" style="color:#555">an inline SVG barchart created with XSLT styled with CSS</a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/dokument_aktiv.png"/><a href="default.asp?file=172558.xml" style="color:#555">a dynamic coin stack chart</a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=306286.xml" style="color:#555">a flexible barchart extension</a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=749340.xml" style="color:#555">Styling XHTML with SVG using XSLT - Part II</a>
														</div>
														<div class="explorer_punkt" style="font-size:0.9em;border:0px">
															<img src="images/icons/docNEU.png"/><a href="default.asp?file=621700.xml" style="color:#555">Styling XHTML with SVG using XSLT - Part I</a>
														</div>
													</div>
												</td>
												<td style="background-image:url(images/layout/pat_app_body_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_links1.png)"></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_mitte1.png)"><div></div></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_rechts1.png)"></td>
											</tr>
										</table>
										<table cellspacing="0" cellpadding="0" border="0" style="width:100%;font-size:0.8em;padding-bottom:10px">
											<tr>
												<td style="width:20px;background-image:url(images/layout/pat_app_top_links2.png);"></td>
												<td style="background-image:url(images/layout/pat_app_top_mitte2.png)">
												</td>
												<td style="width:14px;height:13px;background-image:url(images/layout/pat_app_top_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="background-image:url(images/layout/pat_app_body_links1.png)"></td>
												<td style="background:#fff;vertical-align:top">
													<form action="search.asp">
														<input name="searchterm" type="text" style="width:80%">
														</input>
														<input type="image" src="../images/lupe.png">
														</input>
													</form>
												</td>
												<td style="background-image:url(images/layout/pat_app_body_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_links1.png)"></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_mitte1.png)"><div></div></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_rechts1.png)"></td>
											</tr>
										</table>
										<table cellspacing="0" cellpadding="0" border="0" style="width:100%;font-size:0.8em;padding-bottom:10px">
											<tr>
												<td style="width:20px;background-image:url(images/layout/pat_app_top_links2.png);"></td>
												<td style="background-image:url(images/layout/pat_app_top_mitte2.png)">
												</td>
												<td style="width:14px;height:13px;background-image:url(images/layout/pat_app_top_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="background-image:url(images/layout/pat_app_body_links1.png)"></td>
												<td style="background:#fff;vertical-align:top">
													<ul>
														<li><a href="default.asp?file=129650.xml">Some Bugfixes</a></li>
														<li><a href="default.asp?file=128826.xml">SVG2PNG News</a></li>
														<li><a href="default.asp?file=208660.xml">svg2png</a></li>
														<li><a href="default.asp?file=89031.xml">More animated PNGs</a></li>
														<li><a href="default.asp?file=9380.xml">APNG Edit ,SMIL XSLT and the SVG Logo</a></li>
														<li><a href="default.asp?file=163540.xml">SVG Game creation tutorial - a slot machine part 1</a></li>
														<li><a href="default.asp?file=17498.xml">Inline SVG working again</a></li>
														<li><a href="default.asp?file=284771.xml">a simple svg textbox created with xslt</a></li>
														<li><a href="default.asp?file=313823.xml">scriptable progress bar: mixing XHTML,SVG,XSLT,CSS and JavaScript</a></li>
														<li><a href="default.asp?file=934978.xml">an inline SVG barchart created with XSLT styled with CSS</a></li>
														<li><a href="default.asp?file=172558.xml">a dynamic coin stack chart</a></li>
														<li><a href="default.asp?file=306286.xml">a flexible barchart extension</a></li>
														<li><a href="default.asp?file=749340.xml">Styling XHTML with SVG using XSLT - Part II</a></li>
														<li><a href="default.asp?file=621700.xml">Styling XHTML with SVG using XSLT part1</a></li>
														<li><a href="default.asp?file=643764.xml">a more advanced inline SVG test</a></li>
														<li><a href="default.asp?file=898693.xml">14 Segment LED Font</a></li>
														<li><a href="default.asp?file=857097.xml">testing Inline SVG</a></li>
														<li><a href="default.asp?file=529979.xml">New Design and WorldCup</a></li>
														<li><a href="default.asp?file=716365.xml">Berlin Clock Widget</a></li>
														<li><a href="default.asp?file=580532.xml">Berlin Clock</a></li>
														<li><a href="default.asp?file=755687.xml">SVG Filters and Fonts</a></li>
													</ul>
												</td>
												<td style="background-image:url(images/layout/pat_app_body_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_links1.png)"></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_mitte1.png)"><div></div></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_rechts1.png)"></td>
											</tr>
										</table>
										<table cellspacing="0" cellpadding="0" border="0" style="width:100%;font-size:0.8em;padding-bottom:10px">
											<tr>
												<td style="width:20px;background-image:url(images/layout/pat_app_top_links2.png);"></td>
												<td style="background-image:url(images/layout/pat_app_top_mitte2.png)">
												</td>
												<td style="width:14px;height:13px;background-image:url(images/layout/pat_app_top_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="background-image:url(images/layout/pat_app_body_links1.png)"></td>
												<td style="background:#fff;vertical-align:top">
													<h2>SVG Links</h2><a href="http://www.getsvg.com/forum" style="">getSVG Forum</a><br/><a href="http://blog.codedread.com" style="">Jeff Schiller's Blog</a><br/><a href="http://rr.latenightpc.com/wp" style="">Rob's Blog</a><br/><a href="http://www.openclipart.org" style="">openclipart.org</a><br/><a href="http://www.svgx.org" style="">svgX.org</a><br/><a href="http://www.svg.org" style="">svg.org</a><br/><a href="http://www.svgbasics.com" style="">SVG Basic Tutorial</a><br/><a href="http://www.steltenpower.com" style="">Stelt's Page</a><br/><a href="http://www.jwatt.org" style="">Jonathan's Page</a><br/><a href="http://www.learnsvg.com" style="">Learn SVG Tutorial</a><h2>Off Topic</h2><a href="http://www.klimapartner-berlin.de" style="">KlimaPartner Berlin (de)</a><br/><a href="http://www.titanic-magazin.de" style="">Titanic Magazin (de)</a><br/><a href="http://www.bildblog.de" style="">bildBLOG (de)</a><br/><a href="http://www.penthouse-zermatt.ch/home_de.html" style="">penthouse-zermatt</a></td>
												<td style="background-image:url(images/layout/pat_app_body_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_links1.png)"></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_mitte1.png)"><div></div></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_rechts1.png)"></td>
											</tr>
										</table>
										<table cellspacing="0" cellpadding="0" border="0" style="width:100%;font-size:0.8em;padding-bottom:10px">
											<tr>
												<td style="width:20px;background-image:url(images/layout/pat_app_top_links2.png);"></td>
												<td style="background-image:url(images/layout/pat_app_top_mitte2.png)">
												</td>
												<td style="width:14px;height:13px;background-image:url(images/layout/pat_app_top_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="background-image:url(images/layout/pat_app_body_links1.png)"></td>
												<td style="background:#fff;vertical-align:top">
													<h1>technorati</h1><div>
													</div>
												</td>
												<td style="background-image:url(images/layout/pat_app_body_rechts1.png)"></td>
											</tr>
											<tr>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_links1.png)"></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_mitte1.png)"><div></div></td>
												<td style="height:11px;background-image:url(images/layout/pat_app_foot_rechts1.png)"></td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</td>
						<td style="width:7px;background-image:url(images/layout/bpat_b_r2.png);background-repeat:repeat-y"></td>
					</tr>
				</table>
				<table cellspacing="0" cellpadding="0" border="0" style="width:100%;height:23px">
					<tr>
						<td style="width:20px;background-image:url(images/layout/bpat_f_l1.png);background-repeat:no-repeat"></td>
						<td style="background-image:url(images/layout/bpat_f_m1.png);background-repeat:repeat-x;vertical-align:top;text-align:right; padding-right:5px;font-size:0.7em;color:#333"><div>treebuilder</div></td>
						<td style="width:19px;background-image:url(images/layout/bpat_f_r1.png);background-repeat:no-repeat"></td>
					</tr>
				</table>
			</div>
		</center>
	</body>
</html>