echarts 实现柱状图,并在柱状上添加光标从开始到结束位置循环移动, 如下图
![](https://img-blog.csdnimg.cn/img_convert/b584e8c114eac4a9205570fa63d9310d.gif)
配置如下
option = {
xAxis: {
type: 'category',
data: ['A']
},
yAxis: {
type: 'value'
},
series: [
{
data: [120, 200],
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
},
animation: false
},
{
type: 'lines',
coordinateSystem: 'cartesian2d',
polyline: true,
effect: {
show: true,
period: 1,
trailLength: 0.2,
symbolSize: 8,
symbol: 'circle',
color: '#fff'
},
data: [
{
coords: [
['A', 120.0],
['A', 0.0]
]
}
]
}
]
};