If I use the following code, I can make my circles appear on the graph:
var circles =
groups.selectAll("circle")
.data(data)
.enter().append("circle")
.attr("class", "circles")
.attr({
cx: function(d) { return x(+d.x_axis_Value); },
cy: function(d) { return y(+d.y_axis_value); },
r: function(d) { return d.priority * 10; },
id: function(d) { return d.project; }
})
.style("fill", function(d) { return color(d.status); })
If I instead use the following code, I can get my labels to appear where the circles were:
var circles =
groups.selectAll("circle")
.data(data)
.enter().append("text")
.attr("class", "text")
.attr("y", function (d) { return y(d.y_axis_value); })
.attr("x", function (d) { return x(d.x_axis_value); })
.text(function(d) { return d.project; })
.attr("fill", "white");
But I can't get both the circles and the labels to appear together.
I tried:
groups.selectAll("circle")
.data(data)
.enter().append("circle")
.attr("class", "circles")
.attr({
cx: function(d) { return x(+d.x_axis_value); },
cy: function(d) { return y(+d.y_axis_value); },
r: function(d) { return d.priority * 10; },
id: function(d) { return d.project; }
})
.style("fill", function(d) { return color(d.status); })
.enter().append("text")
.attr("class", "text")
.attr("y", function (d) { return y(d.y_axis_value); })
.attr("x", function (d) { return x(d.x_axis_value); })
.text(function(d) { return d.project; })
.attr("fill", "white");
But this does not work.