我有这个设置
const options = {
responsive: true,
plugins: {
legend: {
position: 'bottom',
labels: {
usePointStyle: true,
pointStyle: 'circle',
// fontSize: 2,
// boxWidth: 6,
// pointStyleWidth: 10,
template: {
maxWidth: 10,
},
},
},
title: {
display: false,
},
},
}
const data = {
labels: ['E-commerce', 'Enterprise', 'Yellow', 'Green', 'Purple'],
datasets: [
{
label: '# of Votes',
data: [12, 19, 3, 5, 3],
backgroundColor: ['#C07CC3', '#9C3848', '#9DDBAD', '#ADA8B6', '#606EDA'],
borderWidth: 1,
},
],
}
我得到了这个设置的图表
我想使点变小,但当我取消注解pointStyleWidth
属性时,宽度变小,但高度保持不变
像这样
1条答案
按热度按时间pzfprimi1#
我发现,我需要
boxWidth
和boxHeight
,并删除pointStyleWidth