From cd6cda2528fefd85d08402ee42a428ae0dedd9f9 Mon Sep 17 00:00:00 2001
From: Markus Birth <mbirth@gmail.com>
Date: Sun, 4 Sep 2016 18:07:27 +0200
Subject: [PATCH] Use includes for yearly templates.

---
 _graph_templates/2009.png.xml | 53 ++++-------------------------------
 _graph_templates/2010.png.xml | 53 ++++-------------------------------
 _graph_templates/2011.png.xml | 53 ++++-------------------------------
 _graph_templates/2012.png.xml | 53 ++++-------------------------------
 _graph_templates/2012.svg.xml | 49 ++------------------------------
 _graph_templates/2013.png.xml | 53 ++++-------------------------------
 6 files changed, 28 insertions(+), 286 deletions(-)

diff --git a/_graph_templates/2009.png.xml b/_graph_templates/2009.png.xml
index 8dcbcf6..077d7e4 100644
--- a/_graph_templates/2009.png.xml
+++ b/_graph_templates/2009.png.xml
@@ -1,55 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<graph>
+<graph xmlns:xi="http://www.w3.org/2001/XInclude">
   <size>600, 600</size>
-  <fileformat>pngcairo font "arial,8"</fileformat>
+  <fileformat>pngcairo font "arial,10"</fileformat>
   <start>year=2009, month=1, day=1, hour=0</start>
-  <stop>year=2009, month=12, day=31, hour=0</stop>
+  <stop>year=2009, month=12, day=31, hour=23</stop>
   <xformat>%b</xformat>
   <xlabel>%Y</xlabel>
   <dateformat></dateformat>
-  <plot>
-    <title>Temperatur (℃)</title>
-    <yrange>-20, 50</yrange>
-    <source>monthly</source>
-    <boxwidth>boxwidth / 2</boxwidth>
-    <subplot>
-      <style>box</style>
-      <colour>1</colour>
-      <title>Mittleres Tagesmaximum</title>
-      <xcalc>data['start'] + timedelta(days=20)</xcalc>
-      <ycalc>data['temp_out_max_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>6</colour>
-      <title>Höchstes Tagesmaximum</title>
-      <xcalc>data['temp_out_max_hi_t']</xcalc>
-      <ycalc>data['temp_out_max_hi']</ycalc>
-    </subplot>
-    <subplot>
-      <style>box</style>
-      <colour>3</colour>
-      <title>Mittleres Nachtminimum</title>
-      <xcalc>data['start'] + timedelta(days=7)</xcalc>
-      <ycalc>data['temp_out_min_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>5</colour>
-      <title>Tiefstes Nachtminimum</title>
-      <xcalc>data['temp_out_min_lo_t']</xcalc>
-      <ycalc>data['temp_out_min_lo']</ycalc>
-    </subplot>
-  </plot>
-  <plot>
-    <yrange>0, 120</yrange>
-    <source>monthly</source>
-    <subplot>
-      <colour>5</colour>
-      <style>box</style>
-      <xcalc>data['start'] + timedelta(days=14)</xcalc>
-      <ycalc>data['rain']</ycalc>
-      <title>Monatl. Regenfall (mm)</title>
-    </subplot>
-  </plot>
+  <xi:include href="includes/year_temp.xml" parse="xml" />
+  <xi:include href="includes/year_rain.xml" parse="xml" />
 </graph>
diff --git a/_graph_templates/2010.png.xml b/_graph_templates/2010.png.xml
index b0eb730..507ca76 100644
--- a/_graph_templates/2010.png.xml
+++ b/_graph_templates/2010.png.xml
@@ -1,55 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<graph>
+<graph xmlns:xi="http://www.w3.org/2001/XInclude">
   <size>600, 600</size>
-  <fileformat>pngcairo font "arial,8"</fileformat>
+  <fileformat>pngcairo font "arial,10"</fileformat>
   <start>year=2010, month=1, day=1, hour=0</start>
-  <stop>year=2010, month=12, day=31, hour=0</stop>
+  <stop>year=2010, month=12, day=31, hour=23</stop>
   <xformat>%b</xformat>
   <xlabel>%Y</xlabel>
   <dateformat></dateformat>
-  <plot>
-    <title>Temperatur (℃)</title>
-    <yrange>-20, 50</yrange>
-    <source>monthly</source>
-    <boxwidth>boxwidth / 2</boxwidth>
-    <subplot>
-      <style>box</style>
-      <colour>1</colour>
-      <title>Mittleres Tagesmaximum</title>
-      <xcalc>data['start'] + timedelta(days=20)</xcalc>
-      <ycalc>data['temp_out_max_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>6</colour>
-      <title>Höchstes Tagesmaximum</title>
-      <xcalc>data['temp_out_max_hi_t']</xcalc>
-      <ycalc>data['temp_out_max_hi']</ycalc>
-    </subplot>
-    <subplot>
-      <style>box</style>
-      <colour>3</colour>
-      <title>Mittleres Nachtminimum</title>
-      <xcalc>data['start'] + timedelta(days=7)</xcalc>
-      <ycalc>data['temp_out_min_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>5</colour>
-      <title>Tiefstes Nachtminimum</title>
-      <xcalc>data['temp_out_min_lo_t']</xcalc>
-      <ycalc>data['temp_out_min_lo']</ycalc>
-    </subplot>
-  </plot>
-  <plot>
-    <yrange>0, 120</yrange>
-    <source>monthly</source>
-    <subplot>
-      <colour>5</colour>
-      <style>box</style>
-      <xcalc>data['start'] + timedelta(days=14)</xcalc>
-      <ycalc>data['rain']</ycalc>
-      <title>Monatl. Regenfall (mm)</title>
-    </subplot>
-  </plot>
+  <xi:include href="includes/year_temp.xml" parse="xml" />
+  <xi:include href="includes/year_rain.xml" parse="xml" />
 </graph>
diff --git a/_graph_templates/2011.png.xml b/_graph_templates/2011.png.xml
index 50c2da9..0f0664a 100644
--- a/_graph_templates/2011.png.xml
+++ b/_graph_templates/2011.png.xml
@@ -1,55 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<graph>
+<graph xmlns:xi="http://www.w3.org/2001/XInclude">
   <size>600, 600</size>
-  <fileformat>pngcairo font "arial,8"</fileformat>
+  <fileformat>pngcairo font "arial,10"</fileformat>
   <start>year=2011, month=1, day=1, hour=0</start>
-  <stop>year=2011, month=12, day=31, hour=0</stop>
+  <stop>year=2011, month=12, day=31, hour=23</stop>
   <xformat>%b</xformat>
   <xlabel>%Y</xlabel>
   <dateformat></dateformat>
-  <plot>
-    <title>Temperatur (℃)</title>
-    <yrange>-20, 50</yrange>
-    <source>monthly</source>
-    <boxwidth>boxwidth / 2</boxwidth>
-    <subplot>
-      <style>box</style>
-      <colour>1</colour>
-      <title>Mittleres Tagesmaximum</title>
-      <xcalc>data['start'] + timedelta(days=20)</xcalc>
-      <ycalc>data['temp_out_max_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>6</colour>
-      <title>Höchstes Tagesmaximum</title>
-      <xcalc>data['temp_out_max_hi_t']</xcalc>
-      <ycalc>data['temp_out_max_hi']</ycalc>
-    </subplot>
-    <subplot>
-      <style>box</style>
-      <colour>3</colour>
-      <title>Mittleres Nachtminimum</title>
-      <xcalc>data['start'] + timedelta(days=7)</xcalc>
-      <ycalc>data['temp_out_min_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>5</colour>
-      <title>Tiefstes Nachtminimum</title>
-      <xcalc>data['temp_out_min_lo_t']</xcalc>
-      <ycalc>data['temp_out_min_lo']</ycalc>
-    </subplot>
-  </plot>
-  <plot>
-    <yrange>0, 120</yrange>
-    <source>monthly</source>
-    <subplot>
-      <colour>5</colour>
-      <style>box</style>
-      <xcalc>data['start'] + timedelta(days=14)</xcalc>
-      <ycalc>data['rain']</ycalc>
-      <title>Monatl. Regenfall (mm)</title>
-    </subplot>
-  </plot>
+  <xi:include href="includes/year_temp.xml" parse="xml" />
+  <xi:include href="includes/year_rain.xml" parse="xml" />
 </graph>
diff --git a/_graph_templates/2012.png.xml b/_graph_templates/2012.png.xml
index 9447e1d..ec15050 100644
--- a/_graph_templates/2012.png.xml
+++ b/_graph_templates/2012.png.xml
@@ -1,55 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<graph>
+<graph xmlns:xi="http://www.w3.org/2001/XInclude">
   <size>600, 600</size>
-  <fileformat>pngcairo font "arial,8"</fileformat>
+  <fileformat>pngcairo font "arial,10"</fileformat>
   <start>year=2012, month=1, day=1, hour=0</start>
-  <stop>year=2012, month=12, day=31, hour=0</stop>
+  <stop>year=2012, month=12, day=31, hour=23</stop>
   <xformat>%b</xformat>
   <xlabel>%Y</xlabel>
   <dateformat></dateformat>
-  <plot>
-    <title>Temperatur (℃)</title>
-    <yrange>-20, 50</yrange>
-    <source>monthly</source>
-    <boxwidth>boxwidth / 2</boxwidth>
-    <subplot>
-      <style>box</style>
-      <colour>1</colour>
-      <title>Mittleres Tagesmaximum</title>
-      <xcalc>data['start'] + timedelta(days=20)</xcalc>
-      <ycalc>data['temp_out_max_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>6</colour>
-      <title>Höchstes Tagesmaximum</title>
-      <xcalc>data['temp_out_max_hi_t']</xcalc>
-      <ycalc>data['temp_out_max_hi']</ycalc>
-    </subplot>
-    <subplot>
-      <style>box</style>
-      <colour>3</colour>
-      <title>Mittleres Nachtminimum</title>
-      <xcalc>data['start'] + timedelta(days=7)</xcalc>
-      <ycalc>data['temp_out_min_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>5</colour>
-      <title>Tiefstes Nachtminimum</title>
-      <xcalc>data['temp_out_min_lo_t']</xcalc>
-      <ycalc>data['temp_out_min_lo']</ycalc>
-    </subplot>
-  </plot>
-  <plot>
-    <yrange>0, 120</yrange>
-    <source>monthly</source>
-    <subplot>
-      <colour>5</colour>
-      <style>box</style>
-      <xcalc>data['start'] + timedelta(days=14)</xcalc>
-      <ycalc>data['rain']</ycalc>
-      <title>Monatl. Regenfall (mm)</title>
-    </subplot>
-  </plot>
+  <xi:include href="includes/year_temp.xml" parse="xml" />
+  <xi:include href="includes/year_rain.xml" parse="xml" />
 </graph>
diff --git a/_graph_templates/2012.svg.xml b/_graph_templates/2012.svg.xml
index be5eb0d..a560b32 100644
--- a/_graph_templates/2012.svg.xml
+++ b/_graph_templates/2012.svg.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<graph>
+<graph xmlns:xi="http://www.w3.org/2001/XInclude">
   <size>600, 600</size>
   <fileformat>svg font "arial,10"</fileformat>
   <start>year=2012, month=1, day=1, hour=0</start>
@@ -7,49 +7,6 @@
   <xformat>%b</xformat>
   <xlabel>%Y</xlabel>
   <dateformat></dateformat>
-  <plot>
-    <title>Temperatur (℃)</title>
-    <yrange>-20, 50</yrange>
-    <source>monthly</source>
-    <boxwidth>boxwidth / 2</boxwidth>
-    <subplot>
-      <style>box</style>
-      <colour>rgb "#f44336"</colour>
-      <title>Mittleres Tagesmaximum</title>
-      <xcalc>data['start'] + timedelta(days=20)</xcalc>
-      <ycalc>data['temp_out_max_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>rgb "#b71c1c"</colour>
-      <title>Höchstes Tagesmaximum</title>
-      <xcalc>data['temp_out_max_hi_t']</xcalc>
-      <ycalc>data['temp_out_max_hi']</ycalc>
-    </subplot>
-    <subplot>
-      <style>box</style>
-      <colour>rgb "#607D8B"</colour>
-      <title>Mittleres Nachtminimum</title>
-      <xcalc>data['start'] + timedelta(days=7)</xcalc>
-      <ycalc>data['temp_out_min_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>rgb "#263238"</colour>
-      <title>Tiefstes Nachtminimum</title>
-      <xcalc>data['temp_out_min_lo_t']</xcalc>
-      <ycalc>data['temp_out_min_lo']</ycalc>
-    </subplot>
-  </plot>
-  <plot>
-    <yrange>0, 120</yrange>
-    <source>monthly</source>
-    <subplot>
-      <colour>rgb "#2196F3"</colour>
-      <style>box</style>
-      <xcalc>data['start'] + timedelta(days=14)</xcalc>
-      <ycalc>data['rain']</ycalc>
-      <title>Monatl. Regenfall (mm)</title>
-    </subplot>
-  </plot>
+  <xi:include href="includes/year_temp.xml" parse="xml" />
+  <xi:include href="includes/year_rain.xml" parse="xml" />
 </graph>
diff --git a/_graph_templates/2013.png.xml b/_graph_templates/2013.png.xml
index e371f0b..83b3f86 100644
--- a/_graph_templates/2013.png.xml
+++ b/_graph_templates/2013.png.xml
@@ -1,55 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
-<graph>
+<graph xmlns:xi="http://www.w3.org/2001/XInclude">
   <size>600, 600</size>
-  <fileformat>pngcairo font "arial,8"</fileformat>
+  <fileformat>pngcairo font "arial,10"</fileformat>
   <start>year=2013, month=1, day=1, hour=0</start>
-  <stop>year=2013, month=12, day=31, hour=0</stop>
+  <stop>year=2013, month=12, day=31, hour=23</stop>
   <xformat>%b</xformat>
   <xlabel>%Y</xlabel>
   <dateformat></dateformat>
-  <plot>
-    <title>Temperatur (℃)</title>
-    <yrange>-20, 50</yrange>
-    <source>monthly</source>
-    <boxwidth>boxwidth / 2</boxwidth>
-    <subplot>
-      <style>box</style>
-      <colour>1</colour>
-      <title>Mittleres Tagesmaximum</title>
-      <xcalc>data['start'] + timedelta(days=20)</xcalc>
-      <ycalc>data['temp_out_max_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>6</colour>
-      <title>Höchstes Tagesmaximum</title>
-      <xcalc>data['temp_out_max_hi_t']</xcalc>
-      <ycalc>data['temp_out_max_hi']</ycalc>
-    </subplot>
-    <subplot>
-      <style>box</style>
-      <colour>3</colour>
-      <title>Mittleres Nachtminimum</title>
-      <xcalc>data['start'] + timedelta(days=7)</xcalc>
-      <ycalc>data['temp_out_min_ave']</ycalc>
-    </subplot>
-    <subplot>
-      <style>+</style>
-      <colour>5</colour>
-      <title>Tiefstes Nachtminimum</title>
-      <xcalc>data['temp_out_min_lo_t']</xcalc>
-      <ycalc>data['temp_out_min_lo']</ycalc>
-    </subplot>
-  </plot>
-  <plot>
-    <yrange>0, 120</yrange>
-    <source>monthly</source>
-    <subplot>
-      <colour>5</colour>
-      <style>box</style>
-      <xcalc>data['start'] + timedelta(days=14)</xcalc>
-      <ycalc>data['rain']</ycalc>
-      <title>Monatl. Regenfall (mm)</title>
-    </subplot>
-  </plot>
+  <xi:include href="includes/year_temp.xml" parse="xml" />
+  <xi:include href="includes/year_rain.xml" parse="xml" />
 </graph>