VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-path-rect-function/

⇱ D3.js | Path.rect() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js | Path.rect() Function

Last Updated : 16 Jun, 2020

D3.js is a library in Javascript, this library is mostly used for making of graph and visualizing data on the HTML SVG elements. D3 stands for Data Driven Documents and mostly used for data visualization. The Path.rect() is used to make a rectangle in a svg element.

Syntax:

Path.rect(x, y, w, h);

Parameters: This function accepts four parameter as mentioned above and described below:

  • X: It is the x-position of the rectangle.
  • Y: It is the y-position of the rectangle.
  • W: It is the width of the rectangle.
  • H: It is the height of the rectangle
Below example illustrate function in D3.js

Example 1:

Output:

👁 Image

Example 2:

Output:

👁 Image
Comment
Article Tags: