簡體   English   中英

chart.js 無法更改標簽點的寬度和高度

[英]chart js Cannot change label's point width and height

我有這個設置

 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道具時它使寬度變小但高度保持不變

像這樣

在此處輸入圖像描述

我想通了,我需要boxWidthboxHeight ,並刪除pointStyleWidth

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM