[bknr-cvs] r1994 - branches/xml-class-rework/projects/bos/statistics
bknr at bknr.net
bknr at bknr.net
Sat Oct 14 13:23:46 UTC 2006
Author: hhubner
Date: 2006-10-14 09:23:45 -0400 (Sat, 14 Oct 2006)
New Revision: 1994
Added:
branches/xml-class-rework/projects/bos/statistics/all-contracts.lxsl
Modified:
branches/xml-class-rework/projects/bos/statistics/
branches/xml-class-rework/projects/bos/statistics/Makefile
branches/xml-class-rework/projects/bos/statistics/buildSVGLineChart.xsl
Log:
Add total sqm sales graphics
Property changes on: branches/xml-class-rework/projects/bos/statistics
___________________________________________________________________
Name: svn:ignore
- contracts-by-week.xsl
contracts-by-week.xml
*.svg
+ all-contracts.xsl
contracts-by-week.xsl
contracts-by-week.xml
*.svg
Modified: branches/xml-class-rework/projects/bos/statistics/Makefile
===================================================================
--- branches/xml-class-rework/projects/bos/statistics/Makefile 2006-10-14 11:25:47 UTC (rev 1993)
+++ branches/xml-class-rework/projects/bos/statistics/Makefile 2006-10-14 13:23:45 UTC (rev 1994)
@@ -1,16 +1,19 @@
BASE_URL = http://192.168.254.132:8080/reports-xml
-YEAR = 2005
+YEAR =
LOGIN =
OUTPUT_DIR = ../payment-website/images/statistics
-GRAPHICS = contracts-by-week.svg
+YEARLY_GRAPHICS = contracts-by-week.svg
+TOTAL_GRAPHICS = all-contracts.svg
all:
- $(MAKE) graphics YEAR=2005
- $(MAKE) graphics YEAR=2006
+ $(MAKE) yearly-graphics YEAR=2005
+ $(MAKE) yearly-graphics YEAR=2006
+ $(MAKE) total-graphics
-graphics: $(GRAPHICS)
+yearly-graphics: $(YEARLY_GRAPHICS)
+total-graphics: $(TOTAL_GRAPHICS)
.SUFFIXES: .lxsl .xsl .svg
@@ -19,5 +22,5 @@
.xsl.svg:
xsltproc -o $*.xml $*.xsl '$(BASE_URL)/$*/$(YEAR)$(LOGIN)'
- xsltproc -o $(OUTPUT_DIR)/$*-$(YEAR).svg buildSVGLineChart.xsl $*.xml
+ xsltproc -o $(OUTPUT_DIR)/$*$(YEAR).svg buildSVGLineChart.xsl $*.xml
rm $*.xml
\ No newline at end of file
Added: branches/xml-class-rework/projects/bos/statistics/all-contracts.lxsl
===================================================================
--- branches/xml-class-rework/projects/bos/statistics/all-contracts.lxsl 2006-10-14 11:25:47 UTC (rev 1993)
+++ branches/xml-class-rework/projects/bos/statistics/all-contracts.lxsl 2006-10-14 13:23:45 UTC (rev 1994)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:loop="http://informatik.hu-berlin.de/loop">
+ <xsl:output method="xml"/>
+
+ <xsl:template match="/response">
+ <xsl:variable name="total_sqms_sold">
+ <xsl:value-of select="sum(contract/@sqm-count)"/>
+ </xsl:variable>
+ <graphData>
+ <sets>
+ <set title="Contracts" marker-type="none" color="#00ff00">
+ <xsl:for-each select="contract">
+ <measure>
+ <xvalue><xsl:value-of select="@universal-time"/></xvalue>
+ <yvalue><xsl:value-of select="@sqm-count + sum(preceding-sibling::*/@sqm-count)"/></yvalue>
+ </measure>
+ </xsl:for-each>
+ </set>
+ </sets>
+ <minx><xsl:value-of select="/response/contract[1]/@universal-time"/></minx>
+ <maxx><xsl:value-of select="/response/contract[last()]/@universal-time"/></maxx>
+ <miny>0</miny>
+ <maxy><xsl:value-of select="$total_sqms_sold"/></maxy>
+ <title>Total square meters sold</title>
+ <xvalues>
+ <xsl:for-each select="/response/contract">
+ <xsl:choose>
+
+ <xsl:when test="(substring(preceding-sibling::*[1]/@date-time, 5, 2) != substring(@date-time, 5, 2)) and (substring(@date-time, 5, 2) = '01')">
+ <xvalue>
+ <value><xsl:value-of select="@universal-time"/></value>
+ <label>Q1/<xsl:value-of select="substring(@date-time, 1, 4)"/></label>
+ <gridline>true</gridline>
+ </xvalue>
+ </xsl:when>
+
+ <xsl:when test="(substring(preceding-sibling::*[1]/@date-time, 5, 2) != substring(@date-time, 5, 2)) and (substring(@date-time, 5, 2) = '04')">
+ <xvalue>
+ <value><xsl:value-of select="@universal-time"/></value>
+ <label>Q2/<xsl:value-of select="substring(@date-time, 1, 4)"/></label>
+ <gridline>true</gridline>
+ </xvalue>
+ </xsl:when>
+
+ <xsl:when test="(substring(preceding-sibling::*[1]/@date-time, 5, 2) != substring(@date-time, 5, 2)) and (substring(@date-time, 5, 2) = '07')">
+ <xvalue>
+ <value><xsl:value-of select="@universal-time"/></value>
+ <label>Q3/<xsl:value-of select="substring(@date-time, 1, 4)"/></label>
+ <gridline>true</gridline>
+ </xvalue>
+ </xsl:when>
+
+ <xsl:when test="(substring(preceding-sibling::*[1]/@date-time, 5, 2) != substring(@date-time, 5, 2)) and (substring(@date-time, 5, 2) = '10')">
+ <xvalue>
+ <value><xsl:value-of select="@universal-time"/></value>
+ <label>Q4/<xsl:value-of select="substring(@date-time, 1, 4)"/></label>
+ <gridline>true</gridline>
+ </xvalue>
+ </xsl:when>
+
+ </xsl:choose>
+ </xsl:for-each>
+ </xvalues>
+ <yvalues>
+ <loop:for name="i" from="10000" to="$total_sqms_sold" step="10000">
+ <yvalue>
+ <value><xsl:value-of select="$i"/></value>
+ <label><xsl:value-of select="$i"/></label>
+ <gridline>true</gridline>
+ </yvalue>
+ </loop:for>
+ </yvalues>
+ </graphData>
+ </xsl:template>
+</xsl:stylesheet>
Modified: branches/xml-class-rework/projects/bos/statistics/buildSVGLineChart.xsl
===================================================================
--- branches/xml-class-rework/projects/bos/statistics/buildSVGLineChart.xsl 2006-10-14 11:25:47 UTC (rev 1993)
+++ branches/xml-class-rework/projects/bos/statistics/buildSVGLineChart.xsl 2006-10-14 13:23:45 UTC (rev 1994)
@@ -38,6 +38,8 @@
<rect width="7" height="22">
</rect>
</g>
+ <g id="none" transform="scale(1)">
+ </g>
<script type="text/javascript">
<![CDATA[
/* this code was largely reused from the excellent website SVG - Learning by Coding (http://svglbc.datenverdrahten.de/) */
More information about the Bknr-cvs
mailing list