Commits

Charlie Clark  committed 2c06aeb

Added CSS trends

  • Participants
  • Parent commits 801d69e

Comments (0)

Files changed (2)

File httparchive/httparchive/views/site_gviz.py

         for r in self.trends:
             table.append([r.labelDate, int(r.reqJS), int(r.bytesJS)])
         return encoder.encode(table)
+
+    @property
+    def trends_css(self):
+        table = Table()
+        table.add_column("Date", datetime.date)
+        table.add_column("CSS Transfer Size", int)
+        table.add_column("CSS Requests", int)
+        for r in self.trends:
+            table.append([r.labelDate, int(r.reqCSS), int(r.bytesCSS)])
+        return encoder.encode(table)

File httparchive/httparchive/views/templates/site_gviz.pt

         chart.draw(data, options);
       }
 
+		google.setOnLoadCallback(trends_css);
+    	function trends_js() {
+        var data = new google.visualization.DataTable(${view.trends_css});
+
+        var options = {
+          title : "CSS Transfer Size & CSS Requests",
+		  series: [
+		  {targetAxisIndex: 0, color:'#400040'},
+		  {targetAxisIndex: 1, color:'#840084'},
+				   ],
+		  vAxes:[
+				{color:'#400040'},
+				{color:'#840084'}
+				]
+        };
+
+        var chart = new google.visualization.LineChart(document.getElementById('trends_css'));
+        chart.draw(data, options);
+      }
+
 	</script>
 
 <a href="#bytesperpage">