I'm having issues understanding d3. I'm trying to load a bunch of .csv files while have a timestamp in the left column and an integer in the right column, representing the number of people present at any point in time in a classroom (every classroom has its own .csv).
Now the idea is to make a pie chart representing a day's worth of people present divided between the multiple classrooms. For example, 65 % classroom 1, 23 % classroom 2 and 12 % classroom 3.
I'm struggling to understand how i would even go about reading these, apparently everything inside the d3.csv() parser is outside the scope of everything outside of it, which is very counter intuitive. I cannot access the things I'm parsing from outside the .csv() method, which is weird, because I'm reading the .csv files as following:
var files = ["Bibliotheek S2.csv","Bibliotheek S8.csv","Euclides S23.csv","Lovelace Ledeganck.csv","Mercator S8.csv","Nadar S8.csv","Ortelius S8.csv","Practicum S2.csv","S12.csv","Thetis INW.csv","Turing S9.csv","Van Straelen S8.csv","Zuse S9.csv"];
dt = {};
files.forEach(function(f){
d3.csv("lokalen/"+f,function(data){
dt[f] = data;
});
});
How would i continue with this? I'm absolutely lost here.
Thanks, Milan