I need to visualise a TSV file with countries, dates and percentages in a slopegraph. Next to that I need to use a CSV file for another assignment, which frankly loads without any issues but I've been stick on this one for more then 1.5 day and I just can't figure it out.
I've made a basic code just to test whether I can display some of the text out of the TSV file. Also when inspecting the elements in the chrome browser I don't see the SVG container. I really would appreciate some help on this subject!!
var container = d3.select("body").append("svg")
.attr("width", 500)
.attr("height", 500);
d3.tsv("18-year-olds-in-education.tsv", function(error, data) {
data.forEach(function(d) {
d.indic_ed,geo\time = d.indic_ed,geo\time;
d.2001 = +d.2001
d.2012 = +d.2012;
});
var text = container.selectAll("text")
.data(data)
.enter()
.append("text");
var textLabels = text
.attr("x", 200)
.attr("y", 200)
.text(function(d) { return d.2012)
.attr("font-family", "sans-serif")
.attr("font-size", "20px")
.attr("fill", "red");
});