您可以简单地在border-radius
元素上使用border-radius
来实现:
canvas
new Chart(document.getElementById("chart"), {
type: "line",
data: {
labels: ["", "", "", "", ""],
datasets: [{
data: [1, 2, 1, 2, 1]
}]
},
options: {
scales: {
xAxes: [{
display: false
}],
yAxes: [{
display: false,
ticks: {
beginAtZero: true
}
}]
}
}
});
canvas {
border-bottom-left-radius: 3em;
border-bottom-right-radius: 3em;
}