Commits

Charlie Clark committed 271e02b

Added Flash trends

Comments (0)

Files changed (2)

httparchive/httparchive/views/site_gviz.py

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

httparchive/httparchive/views/templates/site_gviz.pt

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