Alright, so I'm pretty new at javascript, I'll admit, and I'm sure it's pretty obvious from this post... I know I'm doing something really stupid but I can't place my finger on it.
I'm trying to make a drop down menu display the content from the "Subcategory" column in this csv file I'm working with, but so far all I can get is a drop down list of empty spaces.
What am I doing wrong?
d3.csv("PCC.csv", function(error, data) {
var select = d3.select("body")
.append("div")
.append("select")
select
.on("change", function(d) {
var value = d3.select(this).property("value");
alert(value);
});
select.selectAll("option")
.data(data)
.enter()
.append("option")
.attr("value", function(d) {
return d.TPC;
})
.text(function(d) {
return d.Subcategory;
})
});