配置项如下
var data = [
{time: '1月', count: 121, top: ['fwe@s.com', 'fsadfe@s.com', 'ssd@asd.com']},
{time: '2月', count: 233, top: ['12e@s.com', '78@s.com', 'ssd@asd.com']},
{time: '3月', count: 222, top: ['fsdafe@s.com', 'ghj@s.com', 'sd@asd.com']},
{time: '4月', count: 182, top: ['vzcxve@s.com', 'nn@s.com', 'cxv@asd.com']},
{time: '5月', count: 343, top: ['czxv@s.com', 'cbn@s.com', 'ouiu@asd.com']}
];
option = {
xAxis: {
data: data.map(function (item) {
return item.time;
})
},
yAxis: {},
tooltip: {},
series: [{
type: 'bar',
symbolSize: 20,
label: {
normal: {
show: true
}
},
data: data.map(function (item) {
return {
value: item.count,
tooltip: {
show: true,
formatter: function (params) {
return item.top.join('<br>');
}
}
}
})
}]
};