[英]Chart.js remove the first vertical line
您要刪除的可能是圖表的邊框。 在 Chart.js v2 中,我能夠通過將網格線配置的drawBorder
設置為false
來刪除第一個垂直邊框:
options: {
scales: {
yAxes: [{
gridLines: {
drawBorder: false
}
}]
}
}
在 Chart.js 文檔中,它在https://www.chartjs.org/docs/latest/axes/styling.html#grid-line-configuration 中進行了解釋。
嘗試使用圖表選項 scaleLineColor,並將顏色設置為 0 不透明度:
new Chart(ctx).Bar(data, {
scaleLineColor: 'rgba(0,0,0,0)'
});
http://jsfiddle.net/wb3kcunt/33/
如果您使用的是 chartjs v2,那么 scales.gridLines 中的 showBorder 選項應該可以解決問題:
options:{
scales: {
gridLines:{
showBorder:false
}
}
}
查看文檔:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.