series: [
{
name: '失败任务数',
type: 'bar',
yAxisIndex: 0,
data: failTask,
showBackground: true, //显示柱条的背景色
backgroundStyle: {
color: 'rgba(199, 199, 199, 0.1)',
},
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(0,58,255,0)', // 0% 处的颜色
},
{
offset: 1,
color: '#23BA65', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
},
barWidth: 16,
},
{
name: '失败记录数',
yAxisIndex: 1,
type: 'line',
symbol:`image://${lineCircle}`,
symbolSize:20,
data: logRecords,
itemStyle: {
color: 'rgba(255, 87, 4, 1)',
},
},
],
import lineCircle from ‘@/assets/newImgs/line-circle.svg’;
引入svg图片
路径写法必须为:symbol:image://${lineCircle}