echarts 自定义工具不显示原因:
格式必须是: icon : ' image://(图片/图标的路径) '
var myChartLine = echarts.init(document.getElementById('chartLine'));
var optionLine = {
title: {
text: '数据变化情况',
},
color: ['#B4A08A','#FF3770', '#383838', '#9262A8', '#4484F2','#EFBF0B','#00CD2E'],
tooltip: {//提示
trigger: 'axis'
},
toolbox: {//工具
feature: {
myTool1: {
show: true,
title: 'week',
icon: 'image://imgs/week.png',
onclick: function (){
httpLineFun("week")
},
},
myTool2: {
show: true,
title: 'month',
icon: 'image://imgs/month.png',
itemSize:80,
onclick: function (){
httpLineFun("month")
}
},
myTool3: {
show: true,
title: 'year',
icon: 'image://imgs/year.png',
onclick: function (){
httpLineFun("year")
}
},
},
right:'10%',
},
legend: {
data:topTip,
top:50,
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
top:'30%'
},
xAxis: {//x轴
type: 'category',
boundaryGap: false,
data: time
},
yAxis: {//y轴
type: 'value'
},
series: linemes
};
myChartLine.setOption(optionLine);