这是旧版本的效果
这是使用了新版本,在本地是好用的,设置和旧版本一样,但是上传到阿里云上后,就变成了这样:
下面是具体的代码:
option = {
xAxis: {
type: 'category',
boundaryGap: false,
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value',
min: function (value) {
return Math.round(value.min - Math.abs(value.min)*0.5);
},
max: function (value) {
return Math.round(value.max + Math.abs(value.max)*0.2);
} ,
axisLine: {
show: false,
lineStyle: {
color: '#0d4b94',
width: 1,
}
},
axisLabel: {
show: true,
textStyle: {
color: '#c1e2fa'
}
},
splitLine: {//分割线配置
show: true,
lineStyle: {
color: "rgba(13,72,46,0.3)",
}
}
},
series: [{
data: ydata,
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#000'
}, {
offset: 0.5,
color: 'rgba(0,0,0,0)'
}])
},
}]
};
新的是从https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js下的