[Chartjs]-Chart,js Pie Chart can the gap between a pie chart and the legend be adjusted

1👍

I think the space might be due to your css. Try changing that. This solves your problem as well.

legend:{
position: 'bottom',
labels: {
          boxWidth: 20,
          padding: -10
        }
}

0👍

One propose solution (perhaps there is a better way – still be interested…)

I found, in my case, I could do this just by adjusting the bottom of my container.

Using the following markup..

    <div id='graphc'>
      <canvas (click)='updateClick($event)' #mygraph></canvas>
    </div>

and the following css

#graphc{
  width:100%;
  height: 100%;
  padding: 10px;
  padding-bottom: 120px; // <-- this moves it up
}

enter image description here

This at least does what I was after, though if I stretch, I do always have the gap….

Maybe I could make the css “dynamic” to fix this

enter image description here

Leave a comment