“yu” 2024-07-14 23:33:51 +08:00
parent 8c5366c9c8
commit be606ff614
5 changed files with 664 additions and 609 deletions

View File

@ -123,7 +123,7 @@
<rateLine <rateLine
:rateDate="rateDate_cur" :rateDate="rateDate_cur"
:keysv="key2" :keysv="key2"
v-if="treeAreaId" v-if="rateDate_cur"
></rateLine> ></rateLine>
</div> </div>
<div class="infotitle_box"> <div class="infotitle_box">
@ -474,15 +474,18 @@ const getRateDate = (treeAreaId: string) => {
}).then((res) => { }).then((res) => {
console.log(res, "res"); console.log(res, "res");
if (res?.data.result.length) { if (res.data.result.length>0) {
rateDate_cur = res?.data.result; rateDate_cur = res?.data.result;
// console.log(res, "res"); // console.log(res, "res");
} else { } else {
ElMessage({ // ElMessage({
message: "Congrats, this is a success message.",
type: "success", // message: "",
plain: true, // type: "success",
}); // plain: true,
// });
console.log('暂无数据负载率');
} }
}); });
// let rateDate = rateJSONData as any; // let rateDate = rateJSONData as any;

View File

@ -1,176 +1,174 @@
<template> <template>
<div class="OneLine" ref="OneLine"></div> <div class="OneLine" ref="OneLine"></div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import {
ref, ref,
inject, inject,
onBeforeUnmount, onBeforeUnmount,
getCurrentInstance, getCurrentInstance,
onMounted, onMounted,
watchEffect, watchEffect,
} from "vue"; } from "vue";
import transformFontSize from "@/hooks/transFormSize.ts"; import transformFontSize from "@/hooks/transFormSize.ts";
import "echarts/lib/component/dataZoom"; import "echarts/lib/component/dataZoom";
onMounted(() => { onMounted(() => {
drawOneLine(props.echartArr); drawOneLine(props.echartArr);
}); });
const props = defineProps<{ const props = defineProps<{
echartArr: any[]; echartArr: any[];
}>(); }>();
// echartDOM // echartDOM
const OneLine: any = ref(); const OneLine: any = ref();
// //
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
const drawOneLine = (arr: any) => { const drawOneLine = (arr: any) => {
let myChart = proxy.$echarts.init(OneLine.value); let myChart = proxy.$echarts.init(OneLine.value);
myChart.clear(); myChart.clear();
const option = { const option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
// axisPointer: { type: 'cross' } // axisPointer: { type: 'cross' }
textStyle: { textStyle: {
color: "#FFFFFF", color: "#FFFFFF",
}, },
// padding: transformFontSize(15), // padding: transformFontSize(15),
backgroundColor: "rgba(0,163,166,.9)", // backgroundColor: "rgba(0,163,166,.9)", //
borderColor: "rgba(0,163,166,.9)", borderColor: "rgba(0,163,166,.9)",
borderRadius: 5, borderRadius: 5,
formatter: function (param: any) { formatter: function (param: any) {
let str = ` let str = `
<div style="width:100%:height:100%"> <div style="width:100%:height:100%">
<div style="display:flex;justify-content:space-between;"> ${ <div style="display:flex;justify-content:space-between;"> ${
param[0].name.split(" ")[0] param[0].name.split(" ")[0]
}</div> }</div>
${getDom(param)} ${getDom(param)}
</div>`; </div>`;
function getDom(param: any) { function getDom(param: any) {
let newStr = ""; let newStr = "";
param.forEach((item: any) => { param.forEach((item: any) => {
newStr += `<div style="display:flex;"><div>${ newStr += `<div style="display:flex;"><div>${
item.seriesName item.seriesName
}</div><div>${ }</div><div>${
item.value === undefined ? "0" : item.value item.value === undefined ? "0" : item.value
}kW</div></div>`; }kW</div></div>`;
}); });
return newStr; return newStr;
} }
return str; return str;
},
}, },
legend: { },
top: "0%", legend: {
right: "5%", top: "0%",
orient: "vertical", right: "5%",
data: ["总功率",], orient: "vertical",
itemWidth: transformFontSize(40), data: ["总功率"],
itemHeight: transformFontSize(18), itemWidth: transformFontSize(40),
itemGap:transformFontSize(8), itemHeight: transformFontSize(18),
textStyle: { itemGap: transformFontSize(8),
fontSize: transformFontSize(35), textStyle: {
color: "#FFFFFF", fontSize: transformFontSize(35),
}, color: "#FFFFFF",
}, },
grid: { },
top: "25%", grid: {
left: "8%", top: "25%",
right: "8%", left: "8%",
bottom: "13%", right: "8%",
bottom: "13%",
},
xAxis: {
type: "category",
axisTick: {
show: false,
alignWithLabel: true,
}, },
xAxis: { boundaryGap: false,
type: "category", axisLabel: {
axisTick: { color: "#fff",
show: false, fontSize: transformFontSize(35),
alignWithLabel: true, padding: [0, 0, 0, 30],
// formatter: function (param: any) {
// return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1]
// },
},
// data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
data: arr.map((rtime) => rtime?.timeStamp.slice(-5)),
},
yAxis: {
splitLine: {
show: false,
},
axisLine: {
show: true, //y线
},
type: "value",
name: "kW",
// min: 0,
// max: 100,
nameTextStyle: {
//yname
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 40, 0, 0],
},
position: "left",
axisLabel: {
//
color: "#fff",
fontSize: transformFontSize(35),
formatter: "{value}",
},
},
series: [
{
name: "总功率",
type: "line",
barWidth: 2, //
smooth: true,
showSymbol: false,
itemStyle: {
color: "rgba(18, 231, 227, 1)",
}, },
boundaryGap: false, areaStyle: {
axisLabel: { normal: {
color: "#fff", color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
fontSize: transformFontSize(35), {
padding: [0, 0, 0, 30], offset: 0,
// formatter: function (param: any) { color: "rgba(18, 231, 227, 0.4)",
// return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1] },
// },
},
// data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
data: arr.map((rtime) => rtime?.timeStamp.slice(-5)),
}, {
yAxis: { offset: 1,
splitLine: {
show: false, color: "rgba(18, 231, 227, 0.01)",
}, },
axisLine: { ]),
show: true, //y线
},
type: "value",
name: "kW",
// min: 0,
// max: 100,
nameTextStyle: {
//yname
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 40, 0, 0],
},
position: "left",
axisLabel: {
//
color: "#fff",
fontSize: transformFontSize(35),
formatter: "{value}",
},
},
series: [
{
name: "总功率",
type: "line",
barWidth: 2, //
smooth: true,
showSymbol: false,
itemStyle: {
color: "rgba(18, 231, 227, 1)",
},
areaStyle: {
normal: {
color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(18, 231, 227, 0.4)",
},
{
offset: 1,
color: "rgba(18, 231, 227, 0.01)",
},
]),
},
}, },
},
data: arr.map((yitem) => yitem.p), data: arr.map((yitem) => yitem.p),
// data: [20, 42, 41, 24, 40, 30, 10], // data: [20, 42, 41, 24, 40, 30, 10],
}, },
], ],
};
myChart.setOption(option);
//
window.addEventListener("resize", function () {
myChart.resize();
});
}; };
</script> myChart.setOption(option);
<style scoped> //
.OneLine { window.addEventListener("resize", function () {
height: 100%; myChart.resize();
width: 100%; });
} };
</style> </script>
<style scoped>
.OneLine {
height: 100%;
width: 100%;
}
</style>

View File

@ -81,7 +81,7 @@
/> />
</div> </div>
<div class="right"> <div class="right">
<div class="val">9999</div> <div class="val">{{ total_cur }}</div>
<span>kWh</span> <span>kWh</span>
</div> </div>
</div> </div>
@ -98,7 +98,7 @@
/> />
</div> </div>
<div class="right"> <div class="right">
<div class="val">9999</div> <div class="val">{{ power35kv }}</div>
<span>kWh</span> <span>kWh</span>
</div> </div>
</div> </div>
@ -115,7 +115,7 @@
/> />
</div> </div>
<div class="right"> <div class="right">
<div class="val">9999</div> <div class="val">{{ power10kv }}</div>
<span>kWh</span> <span>kWh</span>
</div> </div>
</div> </div>
@ -132,7 +132,7 @@
/> />
</div> </div>
<div class="right"> <div class="right">
<div class="val">9999</div> <div class="val">{{ power380V }}</div>
<span>kWh</span> <span>kWh</span>
</div> </div>
</div> </div>
@ -140,7 +140,7 @@
</div> </div>
<div class="infotitle"><span>实时发电量曲线</span></div> <div class="infotitle"><span>实时发电量曲线</span></div>
<div class="info2"> <div class="info2">
<powerLine></powerLine> <powerLine :cur_pvArr="cur_pvArr" v-if="cur_pvArrFlag"></powerLine>
</div> </div>
<div class="infotitle"><span>实时功率曲线</span></div> <div class="infotitle"><span>实时功率曲线</span></div>
<div class="info3"> <div class="info3">
@ -217,18 +217,62 @@ import timePvLine from "./timePvLine.vue";
import { useNow, useDateFormat } from "@vueuse/core"; import { useNow, useDateFormat } from "@vueuse/core";
import { id } from "element-plus/es/locale/index.mjs"; import { id } from "element-plus/es/locale/index.mjs";
import { curpower_api } from "@/api/pvPage/pvApi"; import { curpower_api } from "@/api/pvPage/pvApi";
import { pvApi } from '@/api/Osp/svgApi'
onMounted(() => { onMounted(() => {
let Objinput = { orgID: "8af8470a47aad8e20147aad92e400335" }; //
let Objinput={orgID: "8af8470a47aad8e20147aad92e400335"} //
getCurves(Objinput); //{orgID} getCurves(Objinput); //{orgID}
getpv() //线
}); });
// //
let total_cur = ref("0");
let power35kv = ref("0");
let power10kv = ref("0");
let power380V = ref("0");
let cur_pvArrFlag=ref(false)
let cur_pvArr=reactive([]);
//
const getCurves = (datares: any) => { const getCurves = (datares: any) => {
curpower_api(datares).then((res) => { curpower_api(datares)
console.log("res", res); .then((res) => {
}); console.log("res", res);
//
if (res.data) {
if (res.data.total) {
total_cur.value = res.data.total;
}
if (res.data["380V"]) {
power380V.value = res.data["380V"];
}
if (res.data["35kV"]) {
power35kv.value = res.data["35kV"];
}
if (res.data["10kV"]) {
power10kv.value = res.data["10kV"];
}
}
// 线
if(res.data.data){
cur_pvArrFlag.value=true
cur_pvArr=res.data.data;
}
})
.catch((error) => {
console.log(error);
});
}; };
let pvArr = reactive([]) //
let pvArrFlag = ref<boolean>(false)
// 线
const getpv = () => {
pvApi({ mrid: '03DKX-24289' }).then(res => {
console.log(res, 'respv')
pvArr = res.data
if (pvArr.length > 0) {
pvArrFlag.value = true
}
})
}
const HMS = useDateFormat(useNow(), "HH:mm:ss"); // const HMS = useDateFormat(useNow(), "HH:mm:ss"); //
const YMD = useDateFormat(useNow(), "YYYY-MM-DD"); // const YMD = useDateFormat(useNow(), "YYYY-MM-DD"); //

View File

@ -1,229 +1,232 @@
<template> <template>
<div class="ThreeLine" ref="ThreeLine"></div> <div class="ThreeLine" ref="ThreeLine"></div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import {
ref, ref,
inject, inject,
onBeforeUnmount, onBeforeUnmount,
getCurrentInstance, getCurrentInstance,
onMounted, onMounted,
watchEffect, watchEffect,
} from "vue"; } from "vue";
import transformFontSize from "@/hooks/transFormSize.ts"; import transformFontSize from "@/hooks/transFormSize.ts";
import "echarts/lib/component/dataZoom"; import "echarts/lib/component/dataZoom";
onMounted(() => { onMounted(() => {
drawOneLine(); drawOneLine(props.cur_pvArr);
}); });
const props = defineProps<{
cur_pvArr: any;
}>();
// echartDOM // echartDOM
const ThreeLine: any = ref(); const ThreeLine: any = ref();
// //
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
const drawOneLine = () => { const drawOneLine = (arr: any) => {
let myChart = proxy.$echarts.init(ThreeLine.value); let myChart = proxy.$echarts.init(ThreeLine.value);
myChart.clear(); myChart.clear();
const option = { const option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
// axisPointer: { type: 'cross' } // axisPointer: { type: 'cross' }
textStyle: { textStyle: {
color: "#FFFFFF", color: "#FFFFFF",
}, },
// padding: transformFontSize(15), // padding: transformFontSize(15),
backgroundColor: "rgba(0,163,166,.9)", // backgroundColor: "rgba(0,163,166,.9)", //
borderColor: "rgba(0,163,166,.9)", borderColor: "rgba(0,163,166,.9)",
borderRadius: 5, borderRadius: 5,
formatter: function (param: any) { formatter: function (param: any) {
let str = ` let str = `
<div style="width:100%:height:100%"> <div style="width:100%:height:100%">
<div style="display:flex;justify-content:space-between;"> ${ <div style="display:flex;justify-content:space-between;"> ${
param[0].name.split(" ")[0] param[0].name.split(" ")[0]
}</div> }</div>
${getDom(param)} ${getDom(param)}
</div>`; </div>`;
function getDom(param: any) { function getDom(param: any) {
let newStr = ""; let newStr = "";
param.forEach((item: any) => { param.forEach((item: any) => {
newStr += `<div style="display:flex;"><div>${ newStr += `<div style="display:flex;"><div>${
item.seriesName item.seriesName
}负荷</div><div>${ }负荷</div><div>${
item.value === undefined ? "0" : item.value item.value === undefined ? "0" : item.value
}kW</div></div>`; }kW</div></div>`;
}); });
return newStr; return newStr;
} }
return str; return str;
},
}, },
legend: { },
top: "5%", legend: {
// right: "5%", top: "5%",
// orient: "vertical", // right: "5%",
// data: ["", "", ""], // orient: "vertical",
data: ["实时发电量"], // data: ["", "", ""],
data: ["实时发电量"],
itemWidth: transformFontSize(35), itemWidth: transformFontSize(35),
itemHeight: transformFontSize(18), itemHeight: transformFontSize(18),
itemGap:transformFontSize(50), itemGap: transformFontSize(50),
textStyle: { textStyle: {
fontSize: transformFontSize(25), fontSize: transformFontSize(25),
color: "#FFFFFF", color: "#FFFFFF",
},
}, },
grid: { },
top: "25%", grid: {
left: "8%", top: "25%",
right: "8%", left: "8%",
bottom: "13%", right: "8%",
bottom: "13%",
},
xAxis: {
type: "category",
axisTick: {
show: false,
alignWithLabel: true,
}, },
xAxis: { boundaryGap: false,
type: "category", axisLabel: {
axisTick: { color: "#fff",
show: false, fontSize: transformFontSize(35),
alignWithLabel: true, padding: [0, 0, 0, 30],
}, // formatter: function (param: any) {
boundaryGap: false, // return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1]
axisLabel: {
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 0, 0, 30],
// formatter: function (param: any) {
// return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1]
// },
},
data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
},
yAxis: {
splitLine: {
show: false,
},
axisLine: {
show: true, //y线
},
type: "value",
name: "kWh",
// min: 0,
// max: 100,
nameTextStyle: {
//yname
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 50, 0, 0],
},
position: "left",
axisLabel: {
//
color: "#fff",
fontSize: transformFontSize(35),
formatter: "{value}",
},
},
series: [
{
name: "实时发电量",
type: "line",
barWidth: 2, //
smooth: true,
showSymbol: false,
itemStyle: {
color: "rgba(18, 231, 227, 1)",
},
areaStyle: {
normal: {
color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(18, 231, 227, 0.4)",
},
{
offset: 1,
color: "rgba(18, 231, 227, 0.01)",
},
]),
},
},
data: [20, 42, 41, 24, 40, 30, 10],
},
// {
// name: "",
// type: "line",
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(251, 187, 111, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(251, 187, 111, 0.4)",
// },
// {
// offset: 1,
// color: "rgba(251, 187, 111, 0.01)",
// },
// ]),
// },
// },
// data: [30, 12, 11, 24, 20, 30, 30],
// }, // },
// { },
// name: "", // data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
// type: "line", data: arr.map((rtime) => rtime?.timeStamp.slice(-5)),
// barWidth: 2, // },
// smooth: true, yAxis: {
// showSymbol: false, splitLine: {
// itemStyle: { show: false,
// color: "rgba(107, 255, 130, 1)", },
// }, axisLine: {
// areaStyle: { show: true, //y线
// normal: { },
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [ type: "value",
// { name: "kWh",
// offset: 0, // min: 0,
// max: 100,
nameTextStyle: {
//yname
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 50, 0, 0],
},
position: "left",
axisLabel: {
//
color: "#fff",
fontSize: transformFontSize(35),
formatter: "{value}",
},
},
series: [
{
name: "实时发电量",
type: "line",
barWidth: 2, //
smooth: true,
showSymbol: false,
itemStyle: {
color: "rgba(18, 231, 227, 1)",
},
areaStyle: {
normal: {
color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(18, 231, 227, 0.4)",
},
// color: "rgba(107, 255, 130, 0.4)", {
// }, offset: 1,
// { color: "rgba(18, 231, 227, 0.01)",
// offset: 1, },
]),
},
},
// data: [20, 42, 41, 24, 40, 30, 10],
data: arr.map((pvdata) => pvdata.p),
},
// {
// name: "",
// type: "line",
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(251, 187, 111, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(107, 255, 130, 0.01)", // color: "rgba(251, 187, 111, 0.4)",
// }, // },
// ]),
// },
// },
// data: [40, 18, 19, 23, 29, 33, 31],
// },
],
};
myChart.setOption(option);
// // {
window.addEventListener("resize", function () { // offset: 1,
myChart.resize();
}); // color: "rgba(251, 187, 111, 0.01)",
// },
// ]),
// },
// },
// data: [30, 12, 11, 24, 20, 30, 30],
// },
// {
// name: "",
// type: "line",
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(107, 255, 130, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(107, 255, 130, 0.4)",
// },
// {
// offset: 1,
// color: "rgba(107, 255, 130, 0.01)",
// },
// ]),
// },
// },
// data: [40, 18, 19, 23, 29, 33, 31],
// },
],
}; };
</script> myChart.setOption(option);
<style scoped> //
.ThreeLine { window.addEventListener("resize", function () {
height: 100%; myChart.resize();
width: 100%; });
} };
</style> </script>
<style scoped>
.ThreeLine {
height: 100%;
width: 100%;
}
</style>

View File

@ -1,229 +1,236 @@
<template> <template>
<div class="ThreeLine" ref="ThreeLine"></div> <div class="ThreeLine" ref="ThreeLine"></div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { import {
ref, ref,
inject, inject,
onBeforeUnmount, onBeforeUnmount,
getCurrentInstance, getCurrentInstance,
onMounted, onMounted,
watchEffect, watchEffect,
} from "vue"; } from "vue";
import transformFontSize from "@/hooks/transFormSize.ts"; import transformFontSize from "@/hooks/transFormSize.ts";
import "echarts/lib/component/dataZoom"; import "echarts/lib/component/dataZoom";
onMounted(() => { onMounted(() => {
drawOneLine(); drawOneLine();
}); });
// const props = defineProps<{
// cur_pvArr: any;
// }>();
// echartDOM // echartDOM
const ThreeLine: any = ref(); const ThreeLine: any = ref();
// //
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
const drawOneLine = () => { const drawOneLine = () => {
let myChart = proxy.$echarts.init(ThreeLine.value); let myChart = proxy.$echarts.init(ThreeLine.value);
myChart.clear(); myChart.clear();
const option = { const option = {
tooltip: { tooltip: {
trigger: "axis", trigger: "axis",
// axisPointer: { type: 'cross' } // axisPointer: { type: 'cross' }
textStyle: { textStyle: {
color: "#FFFFFF", color: "#FFFFFF",
}, },
// padding: transformFontSize(15), // padding: transformFontSize(15),
backgroundColor: "rgba(0,163,166,.9)", // backgroundColor: "rgba(0,163,166,.9)", //
borderColor: "rgba(0,163,166,.9)", borderColor: "rgba(0,163,166,.9)",
borderRadius: 5, borderRadius: 5,
formatter: function (param: any) { formatter: function (param: any) {
let str = ` let str = `
<div style="width:100%:height:100%"> <div style="width:100%:height:100%">
<div style="display:flex;justify-content:space-between;"> ${ <div style="display:flex;justify-content:space-between;"> ${
param[0].name.split(" ")[0] param[0].name.split(" ")[0]
}</div> }</div>
${getDom(param)} ${getDom(param)}
</div>`; </div>`;
function getDom(param: any) { function getDom(param: any) {
let newStr = ""; let newStr = "";
param.forEach((item: any) => { param.forEach((item: any) => {
newStr += `<div style="display:flex;"><div>${ newStr += `<div style="display:flex;"><div>${
item.seriesName item.seriesName
}负荷</div><div>${ }负荷</div><div>${
item.value === undefined ? "0" : item.value item.value === undefined ? "0" : item.value
}kW</div></div>`; }kW</div></div>`;
}); });
return newStr; return newStr;
} }
return str; return str;
},
}, },
legend: { },
top: "0%", legend: {
right: "5%", top: "0%",
orient: "vertical", right: "5%",
// data: ["", "", ""], orient: "vertical",
data: ["实时功率"], // data: ["", "", ""],
data: ["实时功率"],
itemWidth: transformFontSize(35), itemWidth: transformFontSize(35),
itemHeight: transformFontSize(18), itemHeight: transformFontSize(18),
itemGap:transformFontSize(20), itemGap: transformFontSize(20),
textStyle: { textStyle: {
fontSize: transformFontSize(25), fontSize: transformFontSize(25),
color: "#FFFFFF", color: "#FFFFFF",
},
}, },
grid: { },
top: "25%", grid: {
left: "8%", top: "25%",
right: "8%", left: "8%",
bottom: "13%", right: "8%",
bottom: "13%",
},
xAxis: {
type: "category",
axisTick: {
show: false,
alignWithLabel: true,
}, },
xAxis: { boundaryGap: false,
type: "category", axisLabel: {
axisTick: { color: "#fff",
show: false, fontSize: transformFontSize(35),
alignWithLabel: true, padding: [0, 0, 0, 30],
}, // formatter: function (param: any) {
boundaryGap: false, // return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1]
axisLabel: {
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 0, 0, 30],
// formatter: function (param: any) {
// return param.split(' ')[1].split(':')[0] + ':' + param.split(' ')[1].split(':')[1]
// },
},
data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
},
yAxis: {
splitLine: {
show: false,
},
axisLine: {
show: true, //y线
},
type: "value",
name: "kW",
// min: 0,
// max: 100,
nameTextStyle: {
//yname
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 50, 0, 0],
},
position: "left",
axisLabel: {
//
color: "#fff",
fontSize: transformFontSize(35),
formatter: "{value}",
},
},
series: [
{
name: "实时功率",
type: "line",
barWidth: 2, //
smooth: true,
showSymbol: false,
itemStyle: {
color: "rgba(18, 231, 227, 1)",
},
areaStyle: {
normal: {
color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(18, 231, 227, 0.4)",
},
{
offset: 1,
color: "rgba(18, 231, 227, 0.01)",
},
]),
},
},
data: [20, 42, 41, 24, 40, 30, 10],
},
// {
// name: "",
// type: "line",
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(251, 187, 111, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(251, 187, 111, 0.4)",
// },
// {
// offset: 1,
// color: "rgba(251, 187, 111, 0.01)",
// },
// ]),
// },
// },
// data: [30, 12, 11, 24, 20, 30, 30],
// }, // },
// { },
// name: "", data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
// type: "line", // data: (arr.map((rtime) => rtime?.timeStamp.slice(-8))),
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(107, 255, 130, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(107, 255, 130, 0.4)",
// },
// { // data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
// offset: 1, },
yAxis: {
splitLine: {
show: false,
},
axisLine: {
show: true, //y线
},
type: "value",
name: "kW",
// min: 0,
// max: 100,
nameTextStyle: {
//yname
color: "#fff",
fontSize: transformFontSize(35),
padding: [0, 50, 0, 0],
},
position: "left",
axisLabel: {
//
color: "#fff",
fontSize: transformFontSize(35),
formatter: "{value}",
},
},
series: [
{
name: "实时功率",
type: "line",
barWidth: 2, //
smooth: true,
showSymbol: false,
itemStyle: {
color: "rgba(18, 231, 227, 1)",
},
areaStyle: {
normal: {
color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "rgba(18, 231, 227, 0.4)",
},
// color: "rgba(107, 255, 130, 0.01)", {
// }, offset: 1,
// ]),
// },
// },
// data: [40, 18, 19, 23, 29, 33, 31],
// },
],
};
myChart.setOption(option);
// color: "rgba(18, 231, 227, 0.01)",
window.addEventListener("resize", function () { },
myChart.resize(); ]),
}); },
},
data: [20, 42, 41, 24, 40, 30, 10],
// data: arr.map((pvdata) => pvdata.p),
},
// {
// name: "",
// type: "line",
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(251, 187, 111, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(251, 187, 111, 0.4)",
// },
// {
// offset: 1,
// color: "rgba(251, 187, 111, 0.01)",
// },
// ]),
// },
// },
// data: [30, 12, 11, 24, 20, 30, 30],
// },
// {
// name: "",
// type: "line",
// barWidth: 2, //
// smooth: true,
// showSymbol: false,
// itemStyle: {
// color: "rgba(107, 255, 130, 1)",
// },
// areaStyle: {
// normal: {
// color: new proxy.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
// {
// offset: 0,
// color: "rgba(107, 255, 130, 0.4)",
// },
// {
// offset: 1,
// color: "rgba(107, 255, 130, 0.01)",
// },
// ]),
// },
// },
// data: [40, 18, 19, 23, 29, 33, 31],
// },
],
}; };
</script> myChart.setOption(option);
<style scoped> //
.ThreeLine { window.addEventListener("resize", function () {
height: 100%; myChart.resize();
width: 100%; });
} };
</style> </script>
<style scoped>
.ThreeLine {
height: 100%;
width: 100%;
}
</style>