I would like to create a Chart based on this XML:
<?xml version="1.0" encoding="UTF-8"?>
<DOCUMENT>
<DATE>10/08/2014</DATE>
<USER_NAME>ADMIN</USER_NAME>
<APP_ID>102</APP_ID>
<APP_NAME>Oracle APEX AppBuilder</APP_NAME>
<TITLE>dba_report_chart</TITLE>
<REGION ID="0">
<ROWSET>
<ROW>
<Description></Description>
<Value></Value>
<Date></Date>
</ROW>
</ROWSET>
</REGION>
</DOCUMENT>
Dataset behind this looks like this:
Date Description Value
---- ----- -----
01.01.2014 A 1.2
02.01.2014 A 1.3
03.01.2014 A 0.5
01.01.2014 B 0.3
02.01.2014 B 4.5
03.01.2014 B 4.8
Charttype should be a Line-Chart having one line for each Description-type with the Date on the x-axis. Now here is my try to work out the XML for the Chart.
<Graph depthAngle="50" depthRadius="8" seriesEffect="SE_AUTO_GRADIENT" graphType= "LINE_VERT_ABS">
<LegendArea visible="true"/>
<LocalGridData colCount="{count(xdoxslt:group(.//ROW, 'Date'))}" rowCount="{count(xdoxslt:group(.//ROW, 'Description'))}">
<RowLabels>
<xsl:for-each-group select=".//ROW" group-by="Description">
<Label>
<xsl:value-of select="current-group()/Description"/>
</Label>
</xsl:for-each-group>
</RowLabels>
<ColLabels>
<xsl:for-each select=".//ROW">
<Label>
<xsl:value-of select="Date"/>
</Label>
</xsl:for-each>
</ColLabels>
<DataValues>
<RowData>
<xsl:for-each select=".//ROW" >
<Cell>
<xsl:value-of select="Value"/>
</Cell>
</xsl:for-each>
</RowData>
</DataValues>
</LocalGridData>
</Graph>
Currently it doesn't work at all meaning it's not displaying any Line. I am a new to XML and I don't really know what I am doing or if it's possible to do this grouping with XML/XSL. I just fooled around a lot with the XML created (by the Word BI Publisher Template Builder plugin).
Hope someone can help me, Thanks Thomas.
No comments:
Post a Comment