简体   繁体   中英

chart js Cannot change label's point width and height

I have this settings

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

I get this chart with this settings

图表

I want to make that points smaller but when I uncomment the pointStyleWidth prop it makes width smaller but the height remains the same

Like this

在此处输入图像描述

I figured out, I need both boxWidth and boxHeight , and remove the pointStyleWidth

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM