gpt4 book ai didi

javascript - ChartJS 雷达图雷达线颜色?

转载 作者:行者123 更新时间:2023-12-03 12:20:29 24 4
gpt4 key购买 nike

所以我对此进行了很多研究,但没有找到解决方案,我想改变雷达线的颜色,如下所示:

enter image description here

有没有办法做到这一点?

这是我当前的代码:

new Chart(document.getElementById("result_chart"), {
"type": "radar",
"data": {
"labels": ["Idea", "Timing", "Skills", "Concept", "Market Plan", "MVP", "Revenue Potential", "Competition", "Team", "BMC", "Financial Model"],
"datasets": [{
"label": "Your Results",
"data": [
10,
20,
30,
40,
50,
60,
70,
80,
90,
100,
110
],
"fill": true,
"backgroundColor": "rgba(165, 211, 164, 0.2)",
"borderColor": "rgb(165, 211, 164)",
"pointBackgroundColor": "rgb(165, 211, 164)",
"pointBorderColor": "#fff",
"pointHoverBackgroundColor": "#fff",
"pointHoverBorderColor": "rgb(255, 99, 132)"
}]
},
"options": {
"elements": {
"line": {
"tension": 0,
"borderWidth": 3
}
}
}
});

最佳答案

您可以通过将这些 Prop 添加到图表的比例规范中轻松做到这一点:

scale: {
gridLines: {
color: 'red'
},
angleLines: {
color: 'red'
}
},

视觉输出将是您要求的输出

enter image description here

希望这可以帮助! :)

关于javascript - ChartJS 雷达图雷达线颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60789217/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com