如何去除tooltip内容中的“逗号”
配置项如下
option = {
dataset: {
source: [
['用电量:', 1, 55, 66, 2],
['用电量:', 2, 23, 23, 1],
['用电量:', 3, 38, 23, 1],
['用电量:', 4, 19, 23, 1],
['用电量:', 5, 22, 23, 1],
]
},
title: {
text: '一天用电量分布',
subtext: '纯属虚构'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
formatter:function(e){
var text="";
for (var i = 0; i < e.length; i++) {
text += "<font color="+e[i].color+">●</font> "+e[i].data[0] + e[i].data[2] + " - " + e[i].data[3]+"<br/>";
}
return text;
}
},
legend: {
data:['今天','昨天']
},
toolbox: {
show: true,
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
},
yAxis: {
type: 'value',
axisPointer: {
snap: true
}
},
visualMap: {
show: false,
dimension: 0
},
series: [{
name:'今天',
type: 'line',
encode: {
x: 1,
y: 2,
tooltip: [0, 2,3]
}
},
{
name:'昨天',
type: 'line',
encode: {
x: 1,
y: 3,
tooltip: [0, 2,3]
}
}
]
};