为了账号安全,请及时绑定邮箱和手机立即绑定

ChartJS 雷达图雷达线颜色?

ChartJS 雷达图雷达线颜色?

一只斗牛犬 2022-05-26 10:22:53
所以我对此进行了很多研究,但没有找到解决方案,我想改变雷达线的颜色,如下所示:有没有办法做到这一点?这是我当前的代码: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            }        }    }});
查看完整描述

3 回答

?
RISEBY

TA贡献1856条经验 获得超5个赞

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


scale: {

      gridLines: {

        color: 'red'

      },

      angleLines: {

        color: 'red'

      }

    },

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

//img1.sycdn.imooc.com//628ee4aa0001289b12850451.jpg

查看完整回答
反对 回复 2022-05-26
?
Helenr

TA贡献1780条经验 获得超4个赞

看来库的配置已更改,现在应该如下所示:


...

scales: {

          r: {

            grid: {

              color: "lightgreen",

            },

          }

}        


查看完整回答
反对 回复 2022-05-26
?
白衣非少年

TA贡献1155条经验 获得超0个赞

options: {

        scales: {

            r: {

                max: 100,

                min: 0,

                ticks: {

                    stepSize: 20,

                    textStrokeColor: 'rgb(54, 162, 235)',

                    color: 'rgba(240, 240, 240, 0.5)',

                    backdropColor: 'rgb(47, 56, 62)'

                },

                angleLines: {

                    color: 'rgba(240, 240, 240,0.5)',

                },


                grid: {

                    color: "lightgreen",

                },


            },

            

        

        },

//img1.sycdn.imooc.com//628ee4c20001f00716880760.jpg

查看完整回答
反对 回复 2022-05-26
  • 3 回答
  • 0 关注
  • 188 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号