D3.js | Path.arc() Function
D3.js is mostly used for making of graph and visualizing data on the HTML SVG elements. D3.js has many functions one of which is arc() function. The Path.arc() function is used to make a arc and a circle and other shapes. D3 stands for Data Driven Documents and mostly used for data visualization.
path.arc(x, y, radius, startAngle, endAngle[anticlockwise])
Parameters: This function accepts five parameter as mentioned above and described below:
- x: This parameter holds the x-position of the arc in the SVG.
- y: This parameter holds the y-position of the arc in the SVG.
- radius: This parameter holds the radius of which the arc is to be made.
- startAngle: This parameter holds the start angle of the arc.
- endAngle[anticlockwise]: This parameter holds the angle to which the arc is to be made, if anticlockwise is true, the arc is drawn in the anticlockwise direction.
Note: If the current point is not equal to the starting point of the arc, a straight line is drawn from the current point to the start of the arc.
Below example illustrate the D3.js | Path.arc() Function in D3.js: