http://doc.ucharts.cn/1172164
new uCharts({
$this:_self,
canvasId: canvasId,
type: 'line',
fontSize:11,
legend:{show:true},
dataLabel:true,
dataPointShape:true,
background:'#FFFFFF',
pixelRatio:_self.pixelRatio,
categories: chartData.categories,
series: chartData.series,
animation: true,
xAxis: {
disabled:true,
disableGrid:true,
},
yAxis: {
gridType:'dash',
gridColor:'#CCCCCC',
dashLength:8,
splitNumber:5,
min:10,
max:180,
format:(val)=>{return val.toFixed(0)+'元'}
},
width: _self.cWidth*_self.pixelRatio,
height: _self.cHeight*_self.pixelRatio,
extra: {
lineStyle: 'straight'
}
});
官方文档是这样的,但是我用的时候发现使用
yAxis: {
gridType:'dash',
gridColor:'#CCCCCC',
dashLength:8,
splitNumber:5,
min:10,
max:180,
data: {
axisLineColor: red
}
},
就会报错,而且编译也会出错,后来发现这样写就可以了
yAxis: {
gridType:'dash',
gridColor:'#CCCCCC',
dashLength:8,
splitNumber:5,
min:10,
max:180,
data:[{
axisLineColor: ‘red’
}]
}
data需要是一个数组,在数组的对象里去配置颜色什么的