想要实现的效果
目前以下代码实现的效果
救救孩子吧,实在不知道怎么写了
var option = {
color:['#509AFD','#FC5249'],
backgroundColor: '#fff',
title: {
text: '客户意愿'
},
grid: {
left: 300,
right: 200
},
xAxis: {
type: 'value',
show: false,
axisLabel:{
rotate:45,
},
},
yAxis: {
type: 'category',
show: false
},
series: [{
name: '愿意',
data: [70],
formater(val){
console.log("愿意:"+val)
},
type: 'bar',
stack: '总量',
barWidth: 30, //柱子宽度
cursor: 'default',
itemStyle: {
borderWidth: 30,
borderStyle: 'solid',
borderColor: '#FFFFFF',
color: '#16A9E6',
normal: {
barBorderRadius: [0, 0, 100, 0],//lt,rt,rb,lb
color: new echarts.graphic.LinearGradient(0, 0, 1, 0,[
{offset: 0, color: '#3977E6'},
{offset: 1, color: '#37BBF8'}]
)
}
},
label: {
show: true,
padding: [0, 0, 40, 0],
fontSize:16,
color: '#333333',
},
},
{
name: '不愿意',
data: [99],
type: 'bar',
stack: '总量',
barWidth: 30,
cursor: 'default',
itemStyle: {
borderWidth: 3,
borderStyle: 'solid',
borderColor: 'transparant',
color: '#05A07D',
normal: {
barBorderRadius: [100, 0, 0, 0],//lt,rt,rb,lb
color: new echarts.graphic.LinearGradient(0, 0, 1, 0,[
{offset: 0, color: '#3977E6'},
{offset: 1, color: '#37BBF8'}]
)
}
},
label: {
show: true,
padding: [0, 0, 40, 0],
fontSize: 20,
color: '#333333',
}
}]
};