series: [
{
type: 'bar',
barWidth: 12, // 柱子宽度
showBackground: true,
backgroundStyle: {
color: '#F9FBFC',
},
itemStyle: {
normal: {
barBorderRadius: [6, 6, 0, 0], // 圆角(左上、右上、右下、左下)
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#1283DD' // 0% 处的颜色
}, {
offset: 1,
color: '#ABD8EF' // 100% 处的颜色
}], false), // 渐变
}
},
data: valData
},{
show: true,
type: 'pictorialBar',
symbol: 'rect',
symbolSize: [12, 1], //图形元素的尺寸
symbolMargin: 30,
symbolRepeat: 'repeat',
itemStyle: {
color: '#ffffff'
},
barWidth: 192, // 统计条宽度
z: 3,
data: maxCountArr,
}
]
其中maxCountArr为 柱状图最大值, n条柱为Arr[n]