How to create canvas line using Fabric.js ?
In this article, we are going to see how to create a canvas line using FabricJS. The canvas line means the line is movable and can be stretched according to your requirements. Further, the line can be customized when it comes to initial stroke color and its starting and ending coordinates.
Parameters: This function accepts two parameters as mentioned above and described below:
- points: It specifies the starting and ending coordinates of the line which are in the sequence like start x-coordinate, start y-coordinate, end x-coordinate and end y-coordinate.
- options: It specifies the additional options to be applied.
Example: We can use FabricJS to create simple editable canvas line.