option = {
title: {
text: '堆叠区域图'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
legend: {
orient:'vertical',
formatter: function (name) {
console.log(name
.split(" ").filter(i=>(i))
.map((i, index) => {
return "{" + index + "|" + i + "}";
})
.join(""))
return name
.split(" ").filter(i=>(i))
.map((i, index) => {
return "{" + index + "|" + i + "}";
})
.join("");
},
textStyle: {
rich: {
0: {
width: 90,
},
1: {
width: 90,
},
},
},
// data: ['邮件12% 营销', '联盟广 30%告', '视32频广告', '直接访问', '搜索引擎']
},
toolbox: {
feature: {
saveAsImage: {}
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
boundaryGap: false,
data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '银行转账 48.88% 21.957',
type: 'line',
stack: '总量',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [120, 132, 101, 134, 90, 230, 210]
},
{
name: '金融渠道 28.17% 1704',
type: 'line',
stack: '总量',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [220, 182, 191, 234, 290, 330, 310]
},
{
name: '刷卡 21.54% 8989',
type: 'line',
stack: '总量',
areaStyle: {},
emphasis: {
focus: 'series'
},
data: [150, 232, 201, 154, 190, 330, 410]
},
]
};
ECHART 格式化图例
最新推荐文章于 2025-01-10 21:46:08 发布