I want to get the ref1 data from the csv and write it in the circle with the text following the circle's circumference. The data to draw the circle, which is in the csv as well, works perfectly like shown on the picture, just the text doesn't work. So the pronlem is not the csv reading.
I honestly don't understand it at all. I basically copied this example http://bl.ocks.org/jebeck/196406a3486985d2b92e but it just doesn't show up. No errors related to d3 are visible in the console so I have no way to locate the issue.
This is my full draw circles function, this draws the circles with the dashed circumference. The second block is the csv source for the circles with the dashed circumference. On the image you see the current visualisation. The dashed circles are visible, the text and arc are not.
EDIT: added css
EDIT: this question is wrongly marked as a duplicate, mistakes were made by the original writer of this code (using unsupported function in this version).
function drawCircles(){
d3.csv("/data/education_storyline_input_tab_point_circles_20190911.csv", function(data){
//console.log(data);
var domaincircles = svg.append("svg")
.attr("class","domain");
var circles = domaincircles.selectAll("circle")
.data(data)
.enter()
.append("circle")
.attr("r", function (d) { return d.r*12; })
.attr("cx", function(d) { return x(d.x); })
.attr("cy", function(d) { return y(d.y); })
.attr("class",function(d){return d.type})
.on("mouseover", handleMouseOver )
.on("mouseout", handleMouseOut );
svg.append('defs')
.append('path')
.attr({
d: "m10,20 a10,10 0 0 0 10,40",
id: 'curvedTextPath'
});
svg.append('path')
.attr({
d: "m10,20 a10,10 0 0 0 10,40",
id: 'visiblePath'
});
svg.append('text')
.append('textPath')
.text(data.ref1)
.attr({
startOffset: '50%',
'xlink:href': '#curvedTextPath'
});
});
}
name,x,y,r,ref1,popup_header,popup_text,type,domain,link
housing,25,10,11,#housing,Housing,"Adequate housing constitutes a major challenge for migrants, they often tend to pay higher rents, live in more segregated neighborhoods in lower quality housing",circle_domain,housing,housing_c0
labour,56,10,11,#labour,Labour,"The educational performance is closely interrelated with migrants' chances on the labour market, where they have to combat discrimination, worse working conditions, and working jobs that don't match their qualifications.",circle_domain,labour,labour_c0
path {
stroke: var(--violet);
stroke-width: 2;
fill: none;
position: relative !important;
z-index: 10 !important;
}
text {
font-family: cursive;
font-size: 48px;
font-weight: bold;
text-anchor: middle;
color: black;
z-index: 9000;
}