Skip to content

Commit

Permalink
Minor indent fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Murray committed Apr 17, 2017
1 parent 6217fef commit bb799f5
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions chapter_16/01_initial_chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,29 +130,29 @@ <h1>Monthly Number of Electric-Drive Vehicles Sold in the U.S.: January 2005&nda

//Create scale functions
xScale = d3.scaleTime()
.domain([
d3.min(dataset, function(d) { return d.date; }),
d3.max(dataset, function(d) { return d.date; })
])
.range([padding, w - padding * 2]);
.domain([
d3.min(dataset, function(d) { return d.date; }),
d3.max(dataset, function(d) { return d.date; })
])
.range([padding, w - padding * 2]);

yScale = d3.scaleLinear()
.domain([
0,
d3.max(dataset, function(d) {
var sum = 0;
//Loops once for each row, to calculate
//the total (sum) of sales of all vehicles
for (var i = 0; i < keys.length; i++) {
sum += d[keys[i]].sales;
};
return sum;
})
])
.range([h - padding, padding / 2])
.nice();
.domain([
0,
d3.max(dataset, function(d) {
var sum = 0;

//Loops once for each row, to calculate
//the total (sum) of sales of all vehicles
for (var i = 0; i < keys.length; i++) {
sum += d[keys[i]].sales;
};

return sum;
})
])
.range([h - padding, padding / 2])
.nice();

//Define axes
xAxis = d3.axisBottom()
Expand Down

0 comments on commit bb799f5

Please sign in to comment.