Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

Commit

Permalink
FIX: calculate min and max values in array
Browse files Browse the repository at this point in the history
  • Loading branch information
ravimashru committed May 2, 2017
1 parent 94e2c6e commit a93f904
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/js/yearlycount.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ function drawGraph(data, xVar, yVar) {
let minYear = data[0][xVar.dataName];
let maxYear = data[data.length - 1][xVar.dataName];

let minCount = data[0][yVar.dataName];
let maxCount = data[data.length - 1][yVar.dataName];
let minCount = d3.min(data, function(d) {
return d[yVar.dataName];
});
let maxCount = d3.max(data, function(d) {
return d[yVar.dataName];
});

let margins = {
top: 50,
Expand Down

0 comments on commit a93f904

Please sign in to comment.