chartjs / chartjs-plugin-datalabels

Chart.js plugin to display labels on data elements
https://chartjs-plugin-datalabels.netlify.app
MIT License
874 stars 473 forks source link

Cant align plugins.legent.labels correctly #406

Open batata004 opened 9 months ago

batata004 commented 9 months ago

Please take a look at this graph:

https://www.quemfazsite.com.br/temp/teste1.php

Look at the legend (printscreen below with zoom so you can see better) and see that its text is not vertically aligned with the box.

image

You can see in the code that I set both boxHeight and fontSize to 12 (I copied to you below) and despite that, the rectangle box is not well aligned with the text. I think you should vertical-align:middle both the box and the text so they get well aligned.

legend:{
    display:true,
    position:"top",
    align:"center",
    labels:{
        boxWidth:12,
        boxHeight:12,
        useBorderRadius:true,
        borderRadius:1,
        font:{
            size:12,
        }
    }
}