export default function drpOption(data) { return { tooltip: { trigger: 'axis', }, grid: [ { top: "15%", left: "10%", right: "8%", width: '80%', height: '75%' } ], legend: { // 显示图例 show: true, textStyle: { color: '#fff', }, // 图例的位置 data: ['垂直位移', '库水位'], }, xAxis: [ { type: 'category', data: data.map(o => o.dt),//.reverse(), splitLine: { show: false }, axisLabel: { color: '#fff', fontSize: 12, show:false, }, axisLine: { lineStyle: { color: '#07a6ff', width: 0.5, } }, axisTick: { show: false, }, }, ], yAxis: [ { inverse: false, type: 'value', position: 'left', name: "垂直位移", nameTextStyle: { color: '#fff' }, // nameLocation: "start", axisLabel: { color: '#fff', fontSize: 12, }, splitLine: { show: true, lineStyle: { color: '#07a6ff', width: 0.25, type: 'dotted' } }, axisLine: { show: false }, axisTick: { show: false, }, min: -20, max:20 }, { // gridIndex: 1, type: 'value', position: 'right', name: "库水位", nameTextStyle: { color: '#fff' }, splitLine: { show: false, lineStyle: { color: '#07a6ff', width: 0.25, type: 'dotted' } }, axisLabel: { color: '#fff', fontSize: 12, }, axisLine: { show: false }, axisTick: { show: false, }, min: 0, max: 150 } ], series: [ { yAxisIndex: 0, name: '垂直位移(mm)', type: 'line', symbol: 'none', color: "#0AE0B5", label: { show: false, }, data:data.map(o => o.du_value), }, { yAxisIndex: 1, name: '库水位(m)', type: 'line', color: "#007AFD", symbol: 'none', showSymbol: false, label: { show: false, }, data: data.map(o => o.rz), } ] }; }