|
next
|
 Subject: XML to Google Charts Author: Tony Lavinio Date: 12 Aug 2009 05:43 PM
|
You'd want something more like this:
concat('http://chart.apis.google.com/chart?cht=p3&chd=t:', string-join(/table/row/Actual, ','), '&chs=250x100')
Remember two things: string-join() takes two parameters - the list, and
the character to put between the items. You were using it like concat().
Also, & characters need to be represented as &
Here are some examples in-context for XSLT and XQuery, in case that helps.
<html>
<body>
<img>{ attribute src { concat(
'http://chart.apis.google.com/chart?cht=bvs&chs=100x100&chd=t:',
string-join(/table/row/Actual, ','),
'|'
,string-join(/table/row/Planned, ','),
'&chco=4d89f9,c6d9fd&chbh=20&chds=',
min((0, /table/row/(Actual, Planned))),
',',
max(/table/row/(Actual, Planned))
) } }</img>
</body>
</html>
<?xml version='1.0'?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<img src="{concat(
'http://chart.apis.google.com/chart?cht=bvs&chs=100x100&chd=t:',
string-join(/table/row/Actual, ','),
'|'
,string-join(/table/row/Planned, ','),
'&chco=4d89f9,c6d9fd&chbh=20&chds=',
min((0, /table/row/(Actual, Planned))),
',',
max(/table/row/(Actual, Planned))
)}"/>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
|
|
|