87,919
社区成员
发帖
与我相关
我的任务
分享
option = {
tooltip: {
trigger: 'item',
axisPointer: {
type: 'line'
},
formatter: e => {
return `
合计: ${e.value}<br />
衣服: ${e.data.clothes}<br />
裤子: ${e.data.trousers}<br />
`
}
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
name: '销量合计',
data: [
{
value: 35, // 合计数据,图中折线
clothes: 20, // 衣服
trousers: 15, // 裤子
},
{
value: 28,
clothes: 20,
trousers: 8,
},
{
value: 18,
clothes: 6,
trousers: 12,
},
{
value: 34,
clothes: 12,
trousers: 22,
},
{
value: 42,
clothes: 20,
trousers: 22,
},
{
value: 68,
clothes: 20,
trousers: 48,
},
{
value: 72,
clothes: 45,
trousers: 27,
},
],
type: 'line'
}]
};
option = {
title: {
text: '折线图堆叠'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['邮件营销', '联盟广告']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
},
yAxis: {
type: 'value'
},
series: [
{
name: '邮件营销',
type: 'line',
stack: '总量',
data: [120, 132, 101, 134, 90, 230, 210],
symbolSize: 0,
lineStyle:{
color: 'transparent'
}
},
{
name: '联盟广告',
type: 'line',
stack: '总量',
data: [220, 182, 191, 234, 290, 330, 310],
lineStyle:{
color: '#f60'
}
}
]
};