Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2XB3FinalProject
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Schankula
2XB3FinalProject
Commits
32ecf716
Commit
32ecf716
authored
7 years ago
by
Ray Liu
Browse files
Options
Downloads
Patches
Plain Diff
Edited histogram.jsp
parent
fe47541f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tomcat/webapps/Trawl/histogram.jsp
+66
-58
66 additions, 58 deletions
tomcat/webapps/Trawl/histogram.jsp
with
66 additions
and
58 deletions
tomcat/webapps/Trawl/histogram.jsp
+
66
−
58
View file @
32ecf716
<%@ 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>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment