Jump to content

PIXI Graphics are not sharp


Ravindu89
 Share

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

area.thumb.png.35451d20bba1f18c38e7d3f874f876df.png

Candle Chart Style

candle.thumb.png.3331129372018397882ec337bd8ba93a.png

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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