One-line summary [问题简述]
type为'lines'并且polyline设置为true,怎样才能使得每个线段的tooltip显示起点和终点的相关内容,如echarts2中默认的“起点>终点”
Version & Environment [版本及环境]
- ECharts version [3.5.4]:
- Browser version [与浏览器无关]:
- OS Version [win10]:
Expected behaviour [期望结果]
可以在线段的tooltip中显示“起点>终点”
ECharts option [ECharts配置项]
option = {
title : {
text: '漫游地',
x:'right'
},
tooltip : {
trigger: 'item',
position: 'inside',
formatter: function (v) {
return v['value'][2];
}
},
bmap: {
center: [116,34],
zoom: 12,
roam: true,
},
series: [
{
type: 'lines',
coordinateSystem: 'bmap',
polyline: true,
data: [{coords:[120.2193,30.2592],[121,4878,31.2491],[117.210839.1439]}],
symbol: ['none', 'arrow'],
symbolSize: 10,
silent: true,
lineStyle: {
normal: {
color: '#3399FF',
//color: '#c23531',
// color: 'rgb(200, 35, 45)',
opacity: 0.8,
width: 2,
}
},
progressiveThreshold: 500,
progressive: 200
},
{
type: 'lines',
coordinateSystem: 'bmap',
polyline: true,
data: [{coords:[120.2193,30.2592],[121,4878,31.2491],[117.210839.1439]}],
lineStyle: {
normal: {
color: '#c23531',
width: 0
}
},
effect: {
constantSpeed: 20,
show: true,
trailLength: 0.1,
}
},
{
name: '',
type: 'effectScatter',
coordinateSystem: 'bmap',
rippleEffect: {
brushType: 'stroke'
},
label: {
normal: {
show: false,
}
},
symbolSize: function (val) {
return 10;
},
itemStyle: {
normal: {
color: '#3399FF'
}
},
data: [[120.2193,30.2592,'杭州'],[121,4878,31.2491,'上海'],[117.210839.1439,'天津']]
}
]
}
3条答案
按热度按时间9avjhtql1#
貌似设置polyline: true,symbol就不显示了
cu6pst1q2#
貌似设置polyline: true,symbol就不显示了
我设置了polylone为true,label也不显示了
nkkqxpd93#
貌似设置polyline: true,symbol就不显示了
我设置了polylone为true,label也不显示了
解决了吗老哥