雷达图的分割颜色只能平均分配,修改代码,使其按自己定义的比例
如下图:
源码修改位置:
/lib/component/radar/radarView.js
搜索代码:var ticksCoords = indicatorAxis.getTicksCoords()
在后面新增代码,修改ticksCoords的值即可
if(ticksCoords.length>0){//测试删除
var firstV=ticksCoords[0].coord
var lenN=ticksCoords[ticksCoords.length-1].coord-firstV;
ticksCoords.forEach(function(item,index){
if(index==1){
item.tickValue=1.5;
item.coord=firstV+0.125*lenN;
}else if(index==2){
item.coord=firstV+0.4*lenN;
item.tickValue=2.6;
}else if(index==3){
item.coord=firstV+0.675*lenN;
item.tickValue=3.7;
}else if(index==4){
item.coord=firstV+0.875*lenN;
item.tickValue=4.5;
}
})
}