Chartjs-Chart.js: Line displayed thinner than defined

0๐Ÿ‘

โœ…

I tried a litte bit. But the only solution i found which actually worked, was to add the space with the canvas helpers of chartjs. You can achieve this by adding the following code to your application:

var WIDE_CLIP = {top: 2, bottom: 4};

Chart.canvasHelpers.clipArea = function(ctx, clipArea) {
    ctx.save();
    ctx.beginPath();
    ctx.rect(
      clipArea.left,
      clipArea.top - WIDE_CLIP.top,
      clipArea.right - clipArea.left,
      clipArea.bottom - clipArea.top + WIDE_CLIP.bottom
    );
    ctx.clip();
}

Take a look at this: https://stackoverflow.com/a/46303679/4032712

I tried to use the padding and position options but none of the seems to work for your problem. Hope I could help you with this!

Leave a comment