Skip to content

Commit

Permalink
Fixed bug #1.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmitsch committed Jul 28, 2017
1 parent 837b49d commit 097fc42
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions source/static/js/graphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function makeGraphs(error, projectsJson, statesJson) {
// Define Dimensions.
var amountDim = ndx.dimension(function(d) { return d["Amount"]; });
var dateDim = ndx.dimension(function(d) { return d3.time.month(d["ExactDate"]); });
var monthDateDim = ndx.dimension(function(d) { return d3.time.month(d["ExactDate"]); });
var categoryDim = ndx.dimension(function(d) { return d["Category"]; });
var weekDateDim = ndx.dimension(function(d) { return d3.time.week(d["ExactDate"]); });
var dayDateDim = ndx.dimension(function(d) { return d["ExactDate"]; });
Expand Down Expand Up @@ -110,7 +111,7 @@ function makeGraphs(error, projectsJson, statesJson) {
var amountByUser = actorDim.group().reduceSum(function(d) {return d["Amount"];});

// For monthly balance boxplot.
var monthlyBalance = dateDim.group().reduceSum(d => d["Amount"]);
var monthlyBalance = monthDateDim.group().reduceSum(d => d["Amount"]);

// Determine extrema.
// For dates.
Expand Down Expand Up @@ -288,9 +289,10 @@ function makeGraphs(error, projectsJson, statesJson) {
.height(365)
// .y(d3.scale.linear().domain([-maxExpensesByMonth * 1.1, maxIncomeByMonth * 1.1]))
.elasticY(true)
.dimension(dateDim) // this is actually wrong but can't brush anyway
.dimension(monthDateDim) // this is actually wrong but can't brush anyway
.group(one_bin(monthlyBalance, 'All months'))
.margins({top: 5, right: 20, bottom: 50, left: 65});
.margins({top: 5, right: 20, bottom: 50, left: 65})
.yAxis.ticks(5);

// Configure user charts.
balanceByUserChart
Expand Down
2 changes: 1 addition & 1 deletion source/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="./"><img src="./static/img/icon.png" id='title_icon' alt="Cashflow Monitor" width="20">Cashflow Monitor | 1.2</a>
<a class="navbar-brand" href="./"><img src="./static/img/icon.png" id='title_icon' alt="Cashflow Monitor" width="20">Cashflow Monitor | 1.3</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion source/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="./"><img src="./static/img/icon.png" id='title_icon' alt="Cashflow Monitor" width="20">Cashflow Monitor | 1.2</a>
<a class="navbar-brand" href="./"><img src="./static/img/icon.png" id='title_icon' alt="Cashflow Monitor" width="20">Cashflow Monitor | 1.3</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 097fc42

Please sign in to comment.