如果雷达图值已满,则它会占据 space (Chart.js) 的一半
If a radar chart values are full it occupies half the space (Chart.js)
我创建了一个具有全值的雷达图,但如果它已满,则占用的区域是 50%,有什么办法可以解决这个问题? (即使那是设计好的)。
https://codepen.io/asaadmahmood/pen/XWgrGWg
<canvas id="marksChart" width="600" height="400"></canvas>
var marksCanvas = document.getElementById("marksChart");
var marksData = {
labels: ["English", "Maths", "Physics", "Chemistry", "Biology", "History"],
datasets: [{
label: "Student A",
backgroundColor: "rgba(200,0,0,0.2)",
data: [100, 100, 100, 100, 100, 100]
}]
};
var radarChart = new Chart(marksCanvas, {
type: 'radar',
data: marksData
});
想通了,需要设置:
scales: {
r: {
beginAtZero: true,
}
}
我创建了一个具有全值的雷达图,但如果它已满,则占用的区域是 50%,有什么办法可以解决这个问题? (即使那是设计好的)。
https://codepen.io/asaadmahmood/pen/XWgrGWg
<canvas id="marksChart" width="600" height="400"></canvas>
var marksCanvas = document.getElementById("marksChart");
var marksData = {
labels: ["English", "Maths", "Physics", "Chemistry", "Biology", "History"],
datasets: [{
label: "Student A",
backgroundColor: "rgba(200,0,0,0.2)",
data: [100, 100, 100, 100, 100, 100]
}]
};
var radarChart = new Chart(marksCanvas, {
type: 'radar',
data: marksData
});
想通了,需要设置:
scales: {
r: {
beginAtZero: true,
}
}