Skip to content

Commit

Permalink
added chart to front end
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidJDJ committed Oct 4, 2015
1 parent 2f70587 commit f3734d8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
24 changes: 20 additions & 4 deletions client/js/homeController.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
saburiKonnect.controller('homeController', function($scope, $location){

$scope.year = function() {
var data = [{label: "2013", value: 1000}, {label: "2014", value: 2500}, {label: "2015", value: 2750}]
$scope.thirteen = function() {
data = [{label: "age 5-7", value: 1000}, {label: "age 8-10", value: 2500}, {label: "age 11-12", value: 2750}, {label: "age 13-14", value: 2750}, {label: "age 15-17", value: 2750}, {label: "age 18-20", value: 2750}]
change(data)
// alert("hello")
}
$scope.fourteen = function() {
data = [{label: "age 5-7", value: 1302}, {label: "age 8-10", value: 2300}, {label: "age 11-12", value: 1403}, {label: "age 13-14", value: 2042}, {label: "age 15-17", value: 2750}, {label: "age 18-20", value: 3203}]
change(data)
}
$scope.fifteen = function() {
data = [{label: "age 5-7", value: 3921}, {label: "age 8-10", value: 1392}, {label: "age 11-12", value: 2392}, {label: "age 13-14", value: 2042}, {label: "age 15-17", value: 2942}, {label: "age 18-20", value: 1943}]
change(data)
// alert("hello")
}
Expand Down Expand Up @@ -50,11 +59,18 @@ saburiKonnect.controller('homeController', function($scope, $location){
});
}

change(randomData());
// change(randomData());
var data = [{label: "age 5-7", value: 0}, {label: "age 8-10", value: 1}, {label: "age 11-12", value: 0}, {label: "age 13-14", value: 0}, {label: "age 15-17", value: 0}, {label: "age 18-20", value: 0}]
change(data)

setTimeout(function(){
data = [{label: "age 5-7", value: 3921}, {label: "age 8-10", value: 1392}, {label: "age 11-12", value: 2392}, {label: "age 13-14", value: 2042}, {label: "age 15-17", value: 2942}, {label: "age 18-20", value: 1943}]
change(data)
},500);

d3.select(".randomize")
.on("click", function(){
change(randomData());
// change(randomData());
});


Expand Down
9 changes: 5 additions & 4 deletions client/partials/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
background: white;
}
</style>
<button class="randomize">randomize</button>
<!-- <button class="randomize">randomize</button> -->
<nav class="navbar navbar-default">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
Expand All @@ -76,15 +76,16 @@
</nav>
<div class="text-center">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default" ng-click="year()">Yearly support</button>
<button type="button" class="btn btn-default">Age Distribution</button>
<button type="button" class="btn btn-default" ng-click="thirteen()">2013</button>
<button type="button" class="btn btn-default" ng-click="fourteen()">2014</button>
<button type="button" class="btn btn-default" ng-click="fifteen()">2015</button>
<!-- <button type="button" class="btn btn-default">Right</button> -->
</div>
<div id="absolute">
<div id="chart"></div>
</div>
<div class="kids">
<h1 class="text-center">Search</h1>
<h1 class="text-center">Kids Supported</h1>
</div>
<!-- Modal login -->
<div class="modal fade" id="loginModalSponsor" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
Expand Down

0 comments on commit f3734d8

Please sign in to comment.