option = { backgroundColor: '#000', legend: { show: false, }, tooltip: { show: false, trigger: 'axis', transitionDuration: 0, textStyle: { fontSize: 24, fontWeight: 400, align: 'left' }, }, grid: { top: '20%', left: '5%', right: '5%', bottom: '5%', containLabel: true, }, xAxis: [ { type: "category", boundaryGap: true, data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"], axisLine: { show: false, lineStyle: { color: "rgba(255,255,255,0.45)", }, }, axisTick: { show: false, }, axisLabel: { show: false, textStyle: { color: "rgba(255,255,255,0.45)", }, fontSize: 12, margin: 15, }, axisPointer: { label: { padding: [0, 0, 10, 0], // 这里的margin和axisLabel的margin要一致! margin: 15, fontSize: 12, backgroundColor: { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: "#fff", // 0% 处的颜色 }, { offset: 0.86, color: "#fff", // 0% 处的颜色 }, { offset: 0.86, color: "#33c0cd", // 0% 处的颜色 }, { offset: 1, color: "#33c0cd", // 100% 处的颜色 }, ], global: false, // 缺省为 false }, }, }, }, ], yAxis: [ { type: "value", axisTick: { show: false, }, axisLine: { show: false, lineStyle: { color: "rgba(255, 255, 255, 0.45)", }, }, axisLabel: { show: false, textStyle: { color: "rgba(255, 255, 255, 0.45)", }, }, splitLine: { show: false, }, }, ], series: [ { name: "流入人数", type: "line", data: [0, 30, 45, 52, 54, 53, 46, 35, 20, 0, 20, 35, 46, 53, 54, 52, 45, 30, 0], symbolSize: 1, symbol: "circle", smooth: true, yAxisIndex: 0, showSymbol: false, lineStyle: { width: 3, color: "#780006", shadowColor: "rgba(120, 0, 6, 1)", }, areaStyle: { color: { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: "rgba(120, 0, 6, 0.6)", }, { offset: 1, color: "rgba(120, 0, 6, 0.4)", }, ], global: false, // 缺省为 false }, // color:"rgba(120, 0, 6, .4)" }, }, { name: "流出人数", type: "line", data: [0, -38, -55, -65, -72, -78, -84, -90, -95, -100, -95, -90, -84, -78, -72, -65, -55, -38, 0], symbolSize: 1, symbol: "circle", smooth: true, yAxisIndex: 0, showSymbol: false, lineStyle: { width: 3, color: "#780006", shadowColor: "rgba(120, 0, 6, 1)", }, areaStyle: { color: { type: "linear", x: 0, y: 0, x2: 0, y2: 1, colorStops: [ { offset: 0, color: "rgba(120, 0, 6, 0.4)", }, { offset: 1, color: "rgba(120, 0, 6, 0.6)", }, ], global: false, // 缺省为 false }, // color:"rgba(120, 0, 6, .4)" }, }, ], };