Working on 4w 3

This commit is contained in:
Brady
2019-09-30 22:29:42 -06:00
parent 21d4f28699
commit f2be979bd6
12 changed files with 413 additions and 8 deletions

View File

@@ -21,7 +21,16 @@ class BarChart {
// Create the x and y scales; make
// sure to leave room for the axes
let data = this.chooseData(selectedDimension);
let xaxisHeight = 20;
let yaxisWidth = 20;
let dataNum = [];
data.forEach(x => dataNum.push(x.data));
let datadate = [];
data.forEach(x => datadate.push(x.date));
// Create colorScale
@@ -51,5 +60,19 @@ class BarChart {
// ******* TODO: PART I *******
//Changed the selected data when a user selects a different
// menu item from the drop down.
let currentDataType = d3.select('#dataset')
.node().value;
//.property("value");
let selectedData = [];
this.allData.forEach(x => {
var item = [];
item.date = x["year"];
item.data = x[currentDataType];
selectedData.push(item);
});
console.log(this.allData);
console.log(selectedData);
return selectedData;
}
}

View File

@@ -46,5 +46,11 @@ function chooseData() {
// ******* TODO: PART I *******
// Changed the selected data when a user selects a different
// menu item from the drop down.
let currentDataType = d3.select('#dataset')
.node().value;
//.property("value");
let selectedData = [];
this.allData.forEach(x => selectedData.push(x[currentDataType]));
return selectedData;
}