option = { backgroundColor: "#fff", color: ["#ff974c", "#00eaff", "#1effac", "#2d9fff", "#ffdc4c"], backgroundColor: '#0c2d55', tooltip: { trigger: 'axis' }, legend: { icon: "roundRect", itemWidth: 30, // 线的长度 itemHeight: 2, // 粗细 show: "true", textStyle: { color: "#fff", fontSize: 20, }, data: ['1', '2', '3', '4', '5'], }, grid: { containLabel: true }, xAxis: [{ type: 'category', // boundaryGap: false, data: ['2021年', '2022年', '2023年', '2024年'], axisLine: { show: true, lineStyle: { color: "#099fc5", }, }, axisLabel: { fontSize: 20, color: "#fff", margin: 10, }, }], yAxis: [{ type: "value", name: "%", nameTextStyle: { color: "#fff", fontSize: 20, padding: [0, 0, 10, 0], }, axisLine: { show: true, lineStyle: { color: "#099fc5", }, }, splitLine: { show: true, lineStyle: { color: "#075a77", type: "dashed", }, }, axisTick: { show: false, }, axisLabel: { fontSize: 20, color: "#fff", }, },], series: [{ name: '1', type: 'line', stack: '总量', // symbol: 'none', areaStyle: { normal: {} }, symbolSize: 0, //一定要加这个字段才能显示 itemStyle: { normal: { label: { show: true, formatter: "{a|{c}%}", rich: { a: { color: "#fff", fontSize: 18, lineHeight: 24, height: 24, }, }, position: "top", textStyle: { color: "#fff", fontSize: 18, }, }, }, }, data: [1.4, 0.7, 0.28, 0.14] }, { name: '2', type: 'line', stack: '总量', // symbol: 'none', areaStyle: { normal: {} }, symbolSize: 0, //一定要加这个字段才能显示 itemStyle: { normal: { label: { show: true, formatter: "{a|{c}%}", rich: { a: { color: "#fff", fontSize: 18, lineHeight: 24, height: 24, }, }, position: "top", textStyle: { color: "#fff", fontSize: 18, }, }, }, }, data: [29.1, 14.55, 5.82, 0.14] }, { name: '3', type: 'line', stack: '总量', // symbol: 'none', areaStyle: { normal: {} }, symbolSize: 0, //一定要加这个字段才能显示 itemStyle: { normal: { label: { show: true, formatter: "{a|{c}%}", rich: { a: { color: "#fff", fontSize: 18, lineHeight: 24, height: 24, }, }, position: "top", textStyle: { color: "#fff", fontSize: 18, }, }, }, }, data: [23.8, 30.53, 37.56, 77.56] }, { name: '4', type: 'line', stack: '总量', // symbol: 'none', areaStyle: { normal: {} }, symbolSize: 0, //一定要加这个字段才能显示 itemStyle: { normal: { label: { show: true, formatter: "{a|{c}%}", rich: { a: { color: "#fff", fontSize: 18, lineHeight: 24, height: 24, }, }, position: "top", textStyle: { color: "#fff", fontSize: 18, }, }, }, }, data: [45.7, 54.22, 56.34, 19.39] }, { name: '5', type: 'line', stack: '总量', symbol: 'none', areaStyle: { normal: {} }, data: [0, 0, 0, 0] }] };