var barOption = {
backgroundColor: 'transparent',
grid: {
top: '6%',
bottom: '6%',
left: '23%',
right: '20%'
},
xAxis: {
type: 'value',
max: newValueTop6[newValueTop6.length - 1],
splitLine: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: false
},
axisTick: {
show: false
}
},
yAxis: [{
type: 'category',
data: newCategoryTop6,
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
margin: 10,
textStyle: {
color: '#ffffff',
fontSize: 11
}
}
}, {
type: 'category',
data: newValueTop6,
axisLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
margin: 10,
textStyle: {
color: '#ffffff',
fontSize: 11
}
}
}],
series: [{ //分隔
type: 'pictorialBar',
itemStyle: {
normal: {
color: function(params) {
return myColorTop8[params.dataIndex];
}
},
},
symbolRepeat: 'fixed',
symbolMargin: 2,
symbol: 'rect',
symbolClip: true,
symbolSize: [7, 15],
symbolPosition: 'start',
symbolOffset: [3, -1],
symbolBoundingData: newValueTop6[newValueTop6.length - 1],
data: newValueTop6
}]
};
var barChartTop6 = echarts.init(document.getElementById('chart'));
barChartTop6.setOption(barOption);
Echart - 间隔条状图pictorialBar
最新推荐文章于 2024-05-15 04:48:41 发布