该页面在我的桌面上完美呈现100%,但当我尝试在iPhone上查看该页面时,没有任何图表出现。这是JS代码。
对于不同的图表,其他人看起来就像这样。我不相信我的HTML是问题的根源。
const CHART1 = document.getElementById("mainHurdle");
let mainHurdle = new Chart(CHART1, {
type: 'doughnut',
data: {
labels: [
"Communication",
"Other",
],
datasets: [
{
data: [54, 46],
backgroundColor: [
"rgba(127,168,215,.6)",
"rgba(0,0,0,.2)"
],
hoverBackgroundColor: [
"rgba(127,168,215,.8)",
"rgba(0,0,0,.4)"
],
borderColor: [
"rgba(127,168,215,.8)",
"rgba(0,0,0,.4)"
],
hoverBorderColor: [
"rgba(127,168,215,1)",
"rgba(0,0,0,.6)"
],
borderWidth: [2, 2]
}]
},
options: {
title: {
display: false,
text: "Custom Title",
position: "top",
fontFamily: "'Roboto', 'Arial', sans-serif",
fontSize: 16
},
legend: {
display: false,
fontFamily: "'Roboto', 'Arial', sans-serif",
position: "bottom"
},
cutoutPercentage: 40,
animation: {
animateRotate: true,
animateScale: false,
rotation: Math.PI * -0.5
}
}
});