Jump to content

PIXI Graphics are not sharp


Recommended Posts

I am building a stock chart on PIXI.js. To display different chart styles on chart, I am using PIXI.graphics' drawRect, drawPolygon, lineTo functions. Graphics, Edges, grid lines, text are not sharp in this chart. I would like to say that I've tried several workarounds from the web to make this chart sharp. But those didn't help me. 

Examples how the chart looks on in candle and area chart styles and renderer parameters are shown in below. 

   const renderer = PIXI.autoDetectRenderer(canvas.width, canvas.height,
            {view: canvas, antialias: true, transparent: false, resolution: 1});

        renderer.view.style.position = 'relative';
        renderer.view.style.display = 'block';
        renderer.autoResize = true;
        renderer.backgroundColor = 0xFFFFFF;
Area Chart Style


Candle Chart Style


Would like to hear any advice on the subject.

Thanks in advance!

Link to comment
Share on other sites

  • 2 years later...
On 1/29/2021 at 9:52 PM, enns said:

what to do when using fonts? they are also not sharp.

xLbl = new PIXI.Text(txt, xPointsTextStyle);
xLbl.position.set(Math.round(xMajorPos), Math.rount(yMajorPos));


I think this will helpful. Don't use half integer pixels when drawing objects. 

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...