tsg-web/src/views/Home/MapCtrl/Pops/TuRang/drpOption.js

174 lines
4.0 KiB
JavaScript
Raw Normal View History

2025-03-28 17:31:43 +08:00
export default function drpOption(data,yjData) {
console.log("data",data);
// const maxVal = 0//Math.max(...data.map(obj => obj.drp))
// const max1 = Math.max(...[...data.map(obj => obj.value),...yjData?.map(obj => obj.value)])
// const min1 = Math.min(...[...data.map(obj => obj.value),...yjData?.map(obj => obj.value)])
// const max2 = Math.max(...data.map(obj => obj.rz))
// const min2 = Math.min(...data.map(obj => obj.rz))
// const yj = yjData?.map((item,index)=>{
// return {
// yAxisIndex: 0,
// name: item.yjName,
// type: 'line',
// color: item.color,
// lineStyle: {
// type: "dashed",
// width: 1,
// },
// data: data.map(o => item.value),
// symbol: 'none', // 设置标记点为'none',即去掉圆点
// smooth: 0.5
// }
// })
return {
tooltip: {
trigger: 'axis',
},
grid: [
{
top: "12%",
left: "10%",
right: "8%",
width: '80%',
height: '75%'
},
],
legend: {
top:'3%',
// 显示图例
show: true,
// 图例的位置
data: ["流量"],
},
xAxis: [
{
type: 'category',
data: data.map(o => o.tm),
inverse: false,
splitLine: {
show: false
},
axisLabel: {
padding: [0, 0, 100, 0],
color: '#333',
fontSize: 12,
formatter: val => val.slice(0,10)
},
axisLine: {
lineStyle: {
color: '#d9d9d9',
width: 1,
}
},
axisTick: {
show: false,
},
}
],
yAxis: [
{
// gridIndex: 1,
type: 'value',
position: 'left',
name: "流量(L/s)",
nameTextStyle: {
padding: [0, 0, 10, 10],
color:'#333333',
fontSize: 14
},
splitLine: {
show: true,
lineStyle: {
color: '#bfbfbf',
width: 0.5,
type: 'dotted'
}
},
axisLabel: {
color: '#333',
fontSize: 12,
},
axisLine: {
show: false
// lineStyle: {
// color: '#8c8c8c',
// width: 1,
// }
},
axisTick: {
show: false,
},
// min: Math.floor(min1*0.8),
// max: Math.ceil(max1*1.2),
},
// {
// // gridIndex: 1,
// type: 'value',
// position: 'right',
// name: "库水位(m)",
// nameTextStyle: {
// padding: [0, 0, 10, 10],
// color:'#333333',
// fontSize: 14
// },
// splitLine: {
// show: false,
// lineStyle: {
// color: '#07a6ff',
// width: 0.25,
// type: 'dotted'
// }
// },
// axisLabel: {
// color: '#333',
// fontSize: 12,
// },
// axisLine: {
// show: false
// // lineStyle: {
// // color: '#8c8c8c',
// // width: 1,
// // }
// },
// axisTick: {
// show: false,
// },
// min: Math.floor(min2*0.8),
// max: Math.ceil(max2*1.2),
// }
],
series: [
{
// xAxisIndex: 1,
// yAxisIndex: 0,
name: '流量',
type: 'line',
color: "#d6eaec",
lineStyle: {
// type: "dashed"
},
data: data.map(o => o.value),
symbol: 'none', // 设置标记点为'none',即去掉圆点
smooth: 0.5
},
// ...yj
// {
// // xAxisIndex: 1,
// yAxisIndex: 1,
// name: '库水位',
// type: 'line',
// color: "#60a0f8",
// lineStyle: {
// // type: "dashed"
// },
// data: data.map(o => o.rz),
// symbol: 'none', // 设置标记点为'none',即去掉圆点
// smooth: 0.5
// },
]
};
}