how to make a radial line segment using D3.js -


i'd create line using polar coordinates.

example: line centre @ cx=0, cy=0, @ angle of pi/4, drawn start radius of 4 , end radius of 7.

i use maths , job myself, d3.js appears have radial line generator, i'm finding documentation hard grasp, being d3 noob.

using line generator relatively straightforward. can use default options , specify in data this:

 d3.svg.line.radial()([[4,math.pi/4],[7,math.pi/4]]); 

alternatively, provide data changes , else default:

 var line = d3.svg.line.radial()               .angle(math.pi/4)               .radius(function(d) { return d; });  line([4,7]); 

Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -