6👍
You can use the boxWidth
option to influence the size of the point in the legend:
options: {
legend: {
labels: {
usePointStyle: true,
boxWidth: 6
}
}
}
Looking at the chartjs code (version 2.8), boxWidth
is used as long as it is smaller than fontSize
. fontSize
is used as it gets larger than boxWidth
.
0👍
If you read the documentation of chartjs about legend:
usePointStyle
Label style will match corresponding point style (size is based on fontSize, boxWidth is not used in this case).
So just by adding:
...
labels: {
fontSize: 2,
usePointStyle:true,
}
...
JSFiddle with the modified size
You get the size of the legend points smaller.
Maybe I understood you wrong, if so leave a comment and I will modify my answer to fit the new question
- [Chartjs]-Is it possible in chartjs to hide certain dataset legends?
- [Chartjs]-React-chartjs-2 with chartJs 3: Error "arc" is not a registered element
Source:stackexchange.com