ChartJS雷达图雷达线的颜色?

问题描述 投票:1回答:1

因此,我对此进行了很多研究,但仍未找到解决方案,我想更改雷达线的颜色,如下所示:

enter image description here

有办法吗?

UPDATE我没有输入任何代码,因为没有必要,但这是我的代码:

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
        }
    }
}});
javascript chart.js radar-chart
1个回答
2
投票

您可以通过将这些道具添加到图表的比例尺规格中来轻松实现:

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

视觉输出将是您所要求的一个

enter image description here

希望这会有所帮助! :)

© www.soinside.com 2019 - 2024. All rights reserved.