Jump to content

How to fill area between two lines?


Recommended Posts

I have to make a chart that fills the area between two lines looks like in below. 


I have calculated and drawn two lines and connected each lines (See below image)


And I have used 2 approaches to complete this task.

  1. drawPolygon
  2. Using color for beginFill

and both time I have failed. (See in below)


Please advice me. 

Link to comment
Share on other sites

The result will differ for 2d and webgl. Pixi WebGL Graphics uses "earcut" library to triangulate it, while 2d Graphics uses HTMLCanvasRendering2D Context, and whatever triangulation is inside. You have to change earcut to something else, or do triangulation manually, which is easier condiering your input. You can even use Mesh instead of Graphics.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...