javascript - How to set intersection point of x and y axis -
i using d3.js scatter plot,i want plot x , y axis such intersect @ point(100,75).how this? using
svg.append("g") .attr("class", "axis") .attr("transform", "translate(0," + (padding+223) + ")") .call(xaxis2); //create y2 axis svg.append("g") .attr("class", "axis") .attr("transform", "translate(" + (padding+200) + ",0)") .call(yaxis2);
but not change according scale,and have used variable scale. please let me know if need more information.
you need offset axes respective amount, can determine using scales of axes, i.e.
svg.append("g") .attr("class", "axis") .attr("transform", "translate(0," + yscale(75) + ")") .call(xaxis2);
and y axis. may have tweak offset account other offsets, labels etc.
Comments
Post a Comment