source: trunk/years_ploticus.xsl @ 164

Last change on this file since 164 was 148, checked in by pinsard, 12 years ago

rehab ploticus with version 2.41

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3version="1.0"
4xmlns:d="http://docbook.org/ns/docbook"
5xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
6
7<!--
8
9.. _year_ploticus.xsl:
10
11DESCRIPTION
12===========
13
14production d'un fichier de commande ploticus avec données incorporées pour
15le graphe publications/année
16
17SEE ALSO
18========
19
20alternative :ref:`years_gnuplot.xsl`  (but no histogram, only linepoints)
21
22TODO
23====
24
25voir une solution svg http://www.chez.com/xml/exemples/xslt/barchart/
26
27alternative matplotlib
28
29EVOLUTIONS
30==========
31
32$Id$
33
34- fplod 20120228
35
36  * rewrite ReST header
37  * ploticus command is now (version 2.41) pl
38  * ploticus now accept 4 digits year
39
40- fplod 2008-05-05T09:48:05Z aedon.locean-ipsl.upmc.fr (Darwin)
41
42  * force 2 digits format for years
43
44- fplod 2008-04-29T15:28:53Z aedon.locean-ipsl.upmc.fr (Darwin)
45
46  * chgt for dbk5 in years_ploticus.xsl
47
48- fplod yyymmdd?
49
50  * inspired by /sw/share/ploticus2/pltestsuite/bars3.htm
51    creation
52-->
53
54<xsl:output method="text"/>
55
56<xsl:include href="biblioentry_xml.xsl"/>
57
58<xsl:key name="key_years" match="///d:pubdate" use="."/>
59
60<xsl:template match="d:bibliography">
61#
62#  $ pl -o years.png png years.ploticus
63#
64# source :
65# years.ploticus
66#
67# update :
68# <xsl:value-of select="$makedate"/>
69#
70#proc getdata
71data:
72<!-- loop on years -->
73<xsl:for-each select="///d:pubdate[generate-id(.) = generate-id(key('key_years', .)[1])]">
74 <xsl:sort order="ascending" data-type="number" select="."/>
75 <xsl:call-template name="one_year">
76  <xsl:with-param name="year" select="."/>
77 </xsl:call-template>
78</xsl:for-each>
79
80#proc areadef
81  title: Nb of publications by year date : <xsl:value-of select="$makedate"/>
82  titledetails: align=center
83  xaxis.label: Year
84  xscaletype: date yyyy
85  xaxis.stubs: inc 2 year
86  xaxis.stubformat: yyyy
87  xautorange: datafield=1
88  yaxis.label: Nb of publications
89  yautorange: datafield=2
90  yaxis.stubs: inc
91  yaxis.location: min-0.25
92
93#proc bars
94  lenfield: 2
95  locfield: 1
96  color: red
97  barwidth: 0.25
98  outline: no
99
100</xsl:template>
101
102<xsl:template name="one_year">
103 <xsl:param name="year"/>
104 <xsl:value-of select="format-number(($year),'0000')"/>
105
106 <xsl:text> </xsl:text>
107 <xsl:value-of select="count(/descendant::d:biblioentry[child::d:biblioset[child::d:pubdate=$year]]) "/>
108 <xsl:text>&#xA;</xsl:text>
109</xsl:template>
110
111</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.