Remove January data from graphs. Allow pages to select their colorscheme.
Remove January data from graphs. Allow pages to select their colorscheme.

--- a/ckanext/ga_report/controller.py
+++ b/ckanext/ga_report/controller.py
@@ -448,6 +448,8 @@
     # Sort the points
     for package in data:
         package['data'] = sorted( package['data'], key=lambda x:x['x'] )
+        # Strip the latest month's incomplete analytics
+        package['data'] = package['data'][:-1]
     return data
 
 

--- a/ckanext/ga_report/templates/ga_report/ga_util.html
+++ b/ckanext/ga_report/templates/ga_report/ga_util.html
@@ -30,7 +30,7 @@
  </table>
 
 
-<div py:def="rickshaw_graph(items_json,id,mode='line')">
+<div py:def="rickshaw_graph(items_json,id,mode='line',colorscheme='munin')">
   <div id="chart_container_$id" class="rickshaw_chart_container">
     <div id="y_axis_$id" class="rickshaw_y_axis"></div>
     <div id="chart_$id" class="rickshaw_chart"></div>
@@ -38,7 +38,7 @@
     <script type="text/javascript">
       $(function() {
           var all_series = ${items_json};
-          var palette = new Rickshaw.Color.Palette( { scheme: 'munin' } );
+          var palette = new Rickshaw.Color.Palette( { scheme: '$colorscheme' } );
           $.each(all_series, function(i, object) {
               object['color'] = palette.color();
           });