From 32ecf7165ba1c4f54c7b26a3523ed76ac7365624 Mon Sep 17 00:00:00 2001
From: Ray Liu <rayliu109@gmail.com>
Date: Wed, 28 Mar 2018 09:13:23 -0400
Subject: [PATCH] Edited histogram.jsp

---
 tomcat/webapps/Trawl/histogram.jsp | 124 +++++++++++++++--------------
 1 file changed, 66 insertions(+), 58 deletions(-)

diff --git a/tomcat/webapps/Trawl/histogram.jsp b/tomcat/webapps/Trawl/histogram.jsp
index 67f31a3..c8d04c3 100644
--- a/tomcat/webapps/Trawl/histogram.jsp
+++ b/tomcat/webapps/Trawl/histogram.jsp
@@ -1,58 +1,66 @@
-
-
-
-
-
-<%@ page import="java.util.*, data.Record, model.TrawlExpert, search.BST, search.BasicSearchResult" %>
-<head>
-  <!-- Plotly.js -->
-  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
-</head>
-
-<body>
-  
-  <div id="myDiv"><!-- Plotly chart will be drawn inside this DIV --></div>
-  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
-	<script>
-
-	<%
-
-		TrawlExpert te = (TrawlExpert)request.getServletContext().getAttribute("trawl");
-		BasicSearchResult result = te.rangeSearch(159512, 1960, 2016);
-
-		BST<Integer, Integer> histogram = result.histogram();
-		Iterable<Integer> results = histogram.keys();
-		out.print("var y=[];");
-		out.print("var x=[];");
-		for (Integer year: results){
-			out.print("y.push("+ histogram.get(year) +");");
-			out.print("x.push("+ year +");");
-		}
-
-		out.print((String) request.getAttribute("url"));
-
-	%>
-
-	var data = [
-  	{ 	x: x,
-    	y: y,
-    	type: 'bar',
-    	orientation: 'h',
-     	marker: {
-    	color: 'blue',
-    	},
-  	}
-	];
-
-	var layout = {
-		title: 'Individual count vs Year',
-    	xaxis:{title: 'Year',
-       		autorange:'reversed'
-    	},
-    	yaxis:{title: 'Individual count',
-      		side:'right'
-    		}
-	}
-	Plotly.newPlot('Histogram', data,layout);  
-	</script>
-</body>
+
+
+
+
+
+<%@ page import="java.util.*, data.Record, model.TrawlExpert, search.BST, search.BasicSearchResult" %>
+<head>
+  <!-- Plotly.js -->
+  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
+</head>
+
+<body>
+  
+  <div id="myDiv"><!-- Plotly chart will be drawn inside this DIV --></div>
+  <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
+	<script>
+
+	<%
+
+		TrawlExpert te = (TrawlExpert)request.getServletContext().getAttribute("trawl");
+		BasicSearchResult result = te.rangeSearch(159512, 1960, 2016);
+
+		BST<Integer, Integer> histogram = result.histogram();
+		Iterable<Integer> results = histogram.keys();
+		out.print("var y=[];");
+		out.print("var x=[];");
+		for (Integer year: results){
+			out.print("y.push("+ histogram.get(year) +");");
+			out.print("x.push("+ year +");");
+		}
+
+		out.print((String) request.getAttribute("url"));
+
+	%>
+
+	var data = [
+  	{ 	x: x,
+    	y: y,
+    	type: 'bar',
+    	orientation: 'h',
+     	marker: {
+    	color: 'blue',
+    	},
+  	}
+	];
+
+	var layout = {
+		title: 'Individual count vs Year',
+    	xaxis:{title: 'Year',
+    		titlefont: {
+      			family: 'Courier New, monospace',
+      			size: 18,
+      			color: '#7f7f7f'
+    			}
+    	},
+    	yaxis:{title: 'Individual count',
+    		titlefont: {
+      			family: 'Courier New, monospace',
+      			size: 18,
+      			color: '#7f7f7f'
+    			}
+    		}
+	}
+	Plotly.newPlot('Histogram', data,layout);  
+	</script>
+</body>
-- 
GitLab