存在多条展示label的折线时(此处只画了两条示意),x值相同时,若y值相近或相等,数值会出现重叠或遮挡(如Tue或者Fri时),导致label可能无法正确读数,且不美观,在维持现有需求的前提下(折线需要label,折线每个点的数值为实际数值,所以一定存在相等或相近的情况,要打印,tooltip不可行),是否有解决方案
配置项如下
option = {
title: {
text: 'Awesome Chart'
},
xAxis: {
data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
},
yAxis: {},
series: [{
type: 'line',
data:[210, 282, 194, 334, 190, 330, 250],
itemStyle: {
normal: {
label: {
show: true,
position: "top",
textStyle: {
// color: "#333",
fontSize: 26,
}
}
}
},
},{
type: 'line',
data:[220, 182, 191, 234, 290, 330, 310],
itemStyle: {
normal: {
label: {
show: true,
position: "top",
textStyle: {
// color: "#333",
fontSize: 26,
}
}
}
},
}]
};