Chartjs-ChartJS tooltip label for pie cart being cut

1๐Ÿ‘

โœ…

I would say your tooltip is going off the edge of your canvas, have a look at this jsfiddle for an example. Or see sample code at the end.

Or, without seeing the full code, I might assume that your 2014 chart is overlapping the 2015 chart. Maybe fixed with a z-index in CSS, but then the opposite effect with the other chart may happen?

Same code from jsfiddle:

<div style='width: 300px;'>
    <canvas id='chart'></canvas>
</div>

var ctx = document.getElementById('chart');
var chart = new Chart(ctx, {
    type: 'pie',
    data: {
        labels: ["I am a really really really really really really  really really really really really reallyreally really really really really really long label so long I might go off the chart"],
        datasets: [{
            data: [5],
        }]
    },
    options: {
        legend: {
            display: false
        },
        maintainAspectRatio: false,
        title: {
            display: false,
            fontSize: 16
        }
    }
});

Leave a comment