option = {
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
legend: { data: ['保费', '占比'], selectedMode: false },
tooltip: {
trigger: 'axis',
formatter: '{b0}: {c0}<br />{b1}: {c1}',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'bar',
label:{
// show: true,
// position: 'top',
// distance: 0,
},
itemStyle: {
decal: {
show: true,
symbol: 'rect',
symbolSize: 0.5,
color: '#000',
backgroundColor: '#666',
dashArrayX: [1, 0],
dashArrayY: [6, 2],
rotation: 0,
borderType: 'solid'
}
}
},
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line',
label:{
formatter:function(e) {
console.log(e.value)
return e.data
},
show: true,
position: 'top',
distance: 0,
}
}
]
};
console