option = { //你的代码 backgroundColor: "#000", title: { show: false }, tooltip: { trigger: 'axis', backgroundColor: 'rgba(13,5,30,.6)', borderWidth: 1, borderColor: '#32A1FF', padding: 5, textStyle: { color: '#fff' } }, legend: { right: 'center', top: 5, // icon: 'circle', itemWidth: 14, itemHeight: 10, itemGap: 37, textStyle: { fontSize: 14, fontFamily: 'Source Han Sans CN', fontWeight: 'normal', color: '#FFFFFF' } }, grid: { x: '3%', y: '15%', x2: '5%', y2: '5%', containLabel: true }, xAxis: { type: 'category', axisLabel: { color: 'rgba(255, 255, 255, 0.8)', fontSize: 14, interval: 0, }, axisLine: { show: true, lineStyle: { color: '#2D4377' } }, axisTick: { show: false, }, splitLine: { show: false, lineStyle: { color: '#2D4377', type: "dotted", } }, data: ["武都区", "宕昌县", "文县", "康县", "西和县", "礼县", "成县", "徽县", "两当县"] }, yAxis: { type: 'value', name: "(人)", min: 0, position: 'left', nameTextStyle: { color: "#fff", fontSize: 14, }, axisLine: { show: true, lineStyle: { color: '#2D4377' } }, axisTick: { show: false, }, splitLine: { show: true, lineStyle: { color: '#2D4377', type: "dotted", } }, axisLabel: { formatter: '{value}', textStyle: { color: "#FFFFFF", } }, }, // dataZoom: [ // { // // x轴没有具体的数值 // type: 'inside', // 图形内部的滚动条 // xAxisIndex: [0], // 明确指定滚动的轴 // minValueSpan: 1, // x轴最小的index // maxValueSpan: 3, // x轴最大的index // zoomOnMouseWheel: false // 关闭鼠标滚轮缩放 // } // ], series: [{ name: '因病', type: 'line', // 将类型改为 'line' symbol: 'circle', // 可选,设置折线点的形状,默认为 circle,可选值有空心circle, rect, roundRect, triangle, diamond, pin, arrow 等 symbolSize: 8, // 可选,设置折线点的大小 smooth: true, // 可选,是否平滑曲线,默认false,如果设为true则为平滑曲线 lineStyle: { // 设置线条样式 width: 2, // 线宽 color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#A5ADFF' }, { offset: 1, color: '#9B69EC' }] } }, itemStyle: { // 设置折线点样式 borderColor: '#000', // 边框颜色 borderWidth: 1, // 边框宽度 }, data: [87, 60, 124, 20, 432, 90, 66, 174, 100] }, { name: '因学', type: 'line', symbol: 'circle', symbolSize: 8, smooth: true, lineStyle: { width: 2, color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#E1B031' }, { offset: 1, color: '#FF8143' }] } }, itemStyle: { borderColor: '#000', borderWidth: 1, }, data: [90, 66, 174, 100, 430, 87, 60, 124, 20] }, { name: '因残', type: 'line', symbol: 'circle', symbolSize: 8, smooth: true, lineStyle: { width: 2, color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: '#00BEFF' }, { offset: 1, color: '#247FFF' }] } }, itemStyle: { borderColor: '#000', borderWidth: 1, }, data: [20, 96, 140, 150, 402, 20, 96, 140, 150] } ] };