chartjs / chartjs/chartjs-plugin-datalabels

Cant align plugins.legent.labels correctly

Open
#406 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
920
Forks
507
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/chartjs/chartjs-plugin-datalabels/assets/8988923/204bc49b-826c-4eba-92ff-7820706f55be)

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,
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.