Skip to content
Snippets Groups Projects
Commit 0cc85f83 authored by Diego Alejandro Arias Rodriguez's avatar Diego Alejandro Arias Rodriguez
Browse files
parents 62e22665 9c9e677e
No related branches found
No related tags found
No related merge requests found
update
\ No newline at end of file
......@@ -54,3 +54,11 @@ h1{
text-align:center;
font-family: sans-serif;
}
center {
width: 800px;
}
img
{
margin-left: 200px;
width: 1000px;
}
\ No newline at end of file
......@@ -101,7 +101,7 @@ function sendSport(){
$.ajax({
async: false,
crossDomain: true,
url: 'http://172.26.131.9/couchdb/live_demo2/_design/sports_count/_view/sports_count?group=true&group_level=2',
url: 'http://172.26.131.9/couchdb/live_demo2/_design/retweets_followers/_view/retweets_followers?group=true',
type: 'get',
dataType: 'json',
headers: {
......@@ -136,12 +136,15 @@ counts_by_city = []
data_rows = response_by_city["rows"];
for (row in data_rows) {
console.log(sport);
console.log(data_rows[row]["key"][0]);
if(data_rows[row]["key"][0] == sport)
console.log(data_rows[row]["key"][1]);
if(data_rows[row]["key"][1] == sport)
{
city_by_sport.push(data_rows[row]["key"][1]);
counts_by_city.push(data_rows[row]["value"]);
addData(myChart2,data_rows[row]["key"][1],data_rows[row]["value"]);
city_by_sport.push(data_rows[row]["key"][0]);
console.log(data_rows[row]["value"][0]["sum"]);
console.log(data_rows[row]["value"][0]["count"]);
var avg = data_rows[row]["value"][0]["sum"] / data_rows[row]["value"][0]["count"] ;
counts_by_city.push(avg);
addData(myChart2,data_rows[row]["key"][0],avg);
}
}
......@@ -320,7 +323,7 @@ var myChart2 = new Chart(ctx, {
data: {
labels: city_by_sport,
datasets: [{
label: '# of Interactions',
label: '# Average of Retweets',
data: counts_by_sport,
backgroundColor: [
'rgba(255, 99, 132, 0.5)',
......
frontend/static/aurin.png

99.8 KiB

......@@ -33,7 +33,7 @@
<!-- Display Graph for friend count and how old the user is -->
<!-- <canvas id="myChart2" width="200px" height="200px" justify ="right"></canvas> -->
<label class="header">Bar graph showing the city where the sport is most popular</label>
<label class="header">Sports Engagement by City</label>
<div id="cityfilter">
<label for="sport" >Choose a sport:</label>
<select id="sport" onchange="sendSport()" >
......@@ -50,7 +50,7 @@
</div>
<canvas id="myChart2"></canvas>
<label class="header">Network Of Tweets based on retweets </label>
<label class="header">Network Of Tweets based on replies </label>
<div id="networkcityfilter">
<label for="citynetwork" >Choose a city:</label>
<select id="citynetwork">
......@@ -79,6 +79,8 @@
<button onclick="networkGraph()">Search</button>
</div>
<div id="mynetwork"></div>
<label class="header">English Proficiency and Tweets</label>
<div id="center"><img src="aurin.jpeg"></div>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src = "Sports.js"> </script>
<script type="text/javascript">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment