Javascript 做福塔多。这正是我想要的,也谢谢你的提示。 // Creating Dots on line segment.selectAll("dot") .data(function(d) { return d.linedata; }) .ent
做福塔多。这正是我想要的,也谢谢你的提示。Javascript 做福塔多。这正是我想要的,也谢谢你的提示。 // Creating Dots on line segment.selectAll("dot") .data(function(d) { return d.linedata; }) .ent,javascript,d3.js,Javascript,D3.js,做福塔多。这正是我想要的,也谢谢你的提示。 // Creating Dots on line segment.selectAll("dot") .data(function(d) { return d.linedata; }) .enter().append("circle") .attr("r", 5) .attr("cx", function(d) { //return x(parseDate(new Date(d.mins))) + x.rangeBan
// Creating Dots on line
segment.selectAll("dot")
.data(function(d) {
return d.linedata;
})
.enter().append("circle")
.attr("r", 5)
.attr("cx", function(d) {
//return x(parseDate(new Date(d.mins))) + x.rangeBand() / 2;
return x(d.mins);
})
.attr("cy", function(d) {
return y(d.value);
})
.style("stroke", "white")
.style("fill", function(d) {
return color(this.parentNode.__data__.name);
})
.on("mouseenter", function(d) {
d3.select(this).transition().style("opacity", "0.25");
tooltip.html("<span style='color:" + color(this.parentNode.__data__.name) + ";'>" + this.parentNode.__data__.name + "</span>: " + (d.value + "s")).style("visibility", "visible").style("top", (event.pageY + 10) + "px").style("left", (event.pageX) + "px");
})
.on("mouseleave", function(d) {
d3.select(this).transition().style("opacity", "1");
tooltip.style("visibility", "hidden");
});
var x = d3.scale.ordinal()
.rangeRoundPoints([0, width]);