1. Charlie Clark
  2. python-httparchive

Commits

Charlie Clark  committed 5024d8b

Added Flash trends.

  • Participants
  • Parent commits 271e02b
  • Branches default

Comments (0)

Files changed (2)

File httparchive/httparchive/views/site_gviz.py

View file
         for r in self.trends:
             table.append([r.labelDate, int(r.reqImg), int(r.bytesImg)])
         return encoder.encode(table)
+
+    @property
+    def trends_flash(self):
+        table = Table()
+        table.add_column("Date", datetime.date)
+        table.add_column("Flash Transfer Size", int)
+        table.add_column("Flash Requests", int)
+        for r in self.trends:
+            table.append([r.labelDate, int(r.reqFlash), int(r.bytesFlash)])
+        return encoder.encode(table)

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

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