This commit is contained in:
unknown 2023-12-07 18:20:41 +08:00
commit 0dcfc36183
11 changed files with 585 additions and 552 deletions

13
package-lock.json generated
View File

@ -30,7 +30,6 @@
"@vue/cli-service": "~5.0.0",
"less": "^4.2.0",
"less-loader": "^8.0.0",
"lib-flexible": "^0.3.2",
"postcss": "^8.4.31",
"postcss-preset-env": "^9.3.0",
"vue-template-compiler": "^2.6.14"
@ -8022,12 +8021,6 @@
"node": ">=6"
}
},
"node_modules/lib-flexible": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/lib-flexible/-/lib-flexible-0.3.2.tgz",
"integrity": "sha512-9yowMWA70tKhKdCJDaltY0mNQG4OWo7pWKScnTp9aiSxS7s20ZYlwBRE3335nweOf5qKXVC7sDxJwMPM8/MFZg==",
"dev": true
},
"node_modules/lilconfig": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz",
@ -19185,12 +19178,6 @@
"integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
"dev": true
},
"lib-flexible": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/lib-flexible/-/lib-flexible-0.3.2.tgz",
"integrity": "sha512-9yowMWA70tKhKdCJDaltY0mNQG4OWo7pWKScnTp9aiSxS7s20ZYlwBRE3335nweOf5qKXVC7sDxJwMPM8/MFZg==",
"dev": true
},
"lilconfig": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.1.0.tgz",

View File

@ -29,7 +29,6 @@
"@vue/cli-service": "~5.0.0",
"less": "^4.2.0",
"less-loader": "^8.0.0",
"lib-flexible": "^0.3.2",
"postcss": "^8.4.31",
"postcss-preset-env": "^9.3.0",
"vue-template-compiler": "^2.6.14"

BIN
src/assets/nyjc/今日.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

BIN
src/assets/nyjc/昨日.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View File

@ -3,8 +3,6 @@ import App from "./App.vue";
import "./registerServiceWorker";
import router from "./router";
import store from "./store";
// 动态设置根元素html字体大小
// import "lib-flexible";
Vue.config.productionTip = false;
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";

View File

@ -407,10 +407,13 @@ export default {
},
// 3d
yrfd() {
const offsetX = 24; //bar
const offsetY = 8; //
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
const offsetX = 20;
const offsetY = 10;
//
const CubeLeft = this.$echarts.graphic.extendShape({
const CubeLeft = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -432,7 +435,7 @@ export default {
},
});
//
const CubeRight = this.$echarts.graphic.extendShape({
const CubeRight = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -452,16 +455,15 @@ export default {
},
});
//
const CubeTop = this.$echarts.graphic.extendShape({
const CubeTop = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const c1 = [shape.x, shape.y];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
// const c3 = [shape.x, shape.y - offsetX];
const c3 = [shape.x, shape.y - offsetY * 2];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
const c3 = [shape.x, shape.y - offsetX];
const c4 = [shape.x - offsetX, shape.y - offsetY];
ctx
.moveTo(c1[0], c1[1])
@ -472,75 +474,78 @@ export default {
},
});
//
this.$echarts.graphic.registerShape("CubeLeft", CubeLeft);
this.$echarts.graphic.registerShape("CubeRight", CubeRight);
this.$echarts.graphic.registerShape("CubeTop", CubeTop);
let xAxisData = ["1月", "2月", "3月", "4月", "5月"];
let seriesData = [100, 200, 300, 400, 300];
//
const maxValue = Math.max(...seriesData);
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
let colorArr = [
["#04E886"],
["#0AE841", "rgba(56,231,197,1)"],
["#02C25F", "rgba(11,194,121,1)"],
];
let option = {
// legend: {
// // data: [
// // {
// // icon: "rect",
// // name: "",
// // },
// // ],
// textStyle: {
// color: "#fff",
// fontSize: "20px",
// },
// },
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params, ticket, callback) {
const item = params[1];
return item.name + " : " + item.value;
},
const option = {
legend: {
data: [
{
name: "余热发电量",
textStyle: {
color: "white",
fontSize: 20,
},
itemStyle: {
color: "#0DFC4A", //
},
},
],
},
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
// },
// // formatter: function (params) {
// // const item = params[1]
// // return item.name + ' : ' + item.value
// // }
// },
grid: {
//
left: "5%",
right: "5%",
bottom: "0%",
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
data: xAxisData,
axisLine: {
data: xaxisData,
axisLabel: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
axisTick: {
show: false,
},
axisLabel: {
fontSize: 20,
color: "#fff",
margin: 15,
show: true,
},
},
yAxis: {
type: "value",
name: "单位:t",
splitArea: false,
name: "单位:kWh",
nameTextStyle: {
color: "#fff",
fontSize: 20,
padding: 10,
},
axisLine: {
show: false,
lineStyle: {
width: 2,
color: "#CEDDF2",
},
},
splitLine: {
show: true,
lineStyle: {},
lineStyle: {
color: "#2A353F",
type: "dashed",
},
},
axisTick: {
show: false,
@ -551,13 +556,30 @@ export default {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
// boundaryGap: ['20%', '20%'],
},
series: [
{
name: "余热发电量",
type: "custom",
name: "余热发电",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [-20, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#0BE73B", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
@ -577,11 +599,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[1][0],
color: "#09E63A",
},
{
offset: 1,
color: colorArr[1][1],
color: "#39E7C7",
},
]),
},
@ -600,11 +622,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[2][0],
color: "#00C35A",
},
{
offset: 1,
color: colorArr[2][1],
color: "#09C379",
},
]),
},
@ -623,11 +645,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[0][0],
color: "#05E6A5",
},
{
offset: 1,
color: colorArr[0][0],
color: "#12DE63",
},
]),
},
@ -635,27 +657,7 @@ export default {
],
};
},
data: seriesData,
},
{
type: "bar",
label: {
normal: {
show: true,
position: "top",
formatter: (e) => {
return e.value === maxValue ? e.value : "";
},
fontSize: 20,
color: "#09E83E",
offset: [0, -15],
},
},
itemStyle: {
color: "transparent",
},
tooltip: {},
data: seriesData,
data: yaxisData,
},
],
};

View File

@ -404,11 +404,9 @@ export default {
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
let yaxisData2 = [60, 56, 34, 69, 79];
//
const maxValue = Math.max(...yaxisData);
const maxValue2 = Math.max(...yaxisData2);
const offsetX = 15;
const offsetY = 5;
const offsetX = 20;
const offsetY = 10;
//
const CubeLeft = echarts.graphic.extendShape({
shape: {
@ -418,6 +416,7 @@ export default {
buildPath: function (ctx, shape) {
// canvasshapecustom
const xAxisPoint = shape.xAxisPoint;
// console.log(shape);
const c0 = [shape.x, shape.y];
const c1 = [shape.x - offsetX, shape.y - offsetY];
const c2 = [xAxisPoint[0] - offsetX, xAxisPoint[1] - offsetY];
@ -430,7 +429,6 @@ export default {
.closePath();
},
});
//
const CubeRight = echarts.graphic.extendShape({
shape: {
@ -451,7 +449,6 @@ export default {
.closePath();
},
});
//
const CubeTop = echarts.graphic.extendShape({
shape: {
@ -460,7 +457,7 @@ export default {
},
buildPath: function (ctx, shape) {
const c1 = [shape.x, shape.y];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
const c3 = [shape.x, shape.y - offsetX];
const c4 = [shape.x - offsetX, shape.y - offsetY];
ctx
@ -471,67 +468,122 @@ export default {
.closePath();
},
});
//
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
let option = {
const option = {
legend: {
data: [
{ icon: "rect", name: "昨日" },
{ icon: "rect", name: "今日" },
{
name: "昨日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
},
{
name: "今日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
},
],
textStyle: {
color: "#fff",
fontSize: "20px",
},
},
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
// },
// // formatter: function (params) {
// // const item = params[1]
// // return item.name + ' : ' + item.value
// // }
// },
grid: {
left: "1%",
right: "0%",
top: "16%",
bottom: "5%",
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
data: xaxisData,
axisLine: {
axisLabel: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
axisTick: {
show: true,
},
axisLabel: {
fontSize: 20,
color: "#FFFFFF",
},
},
yAxis: {
type: "value",
splitArea: false,
name: "单位:kWh",
nameTextStyle: {
color: "#fff",
fontSize: 20,
padding: 10,
},
axisLine: {
show: false,
lineStyle: {
width: 2,
color: "#CEDDF2",
},
},
splitLine: {
show: true,
lineStyle: {
color: "#2A353F",
type: "dashed",
},
},
axisTick: {
show: false,
},
axisLabel: {
fontSize: 20,
color: "#FFFFFF",
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
},
series: [
{
type: "custom",
name: "昨日",
name: "今日",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [25, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#24BDF2", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
x: 30,
children: [
{
type: "CubeLeft",
@ -547,15 +599,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#08E83C",
},
{
offset: 0.35,
color: "#1FE77D",
color: "#4567FF",
},
{
offset: 1,
color: "#38E7C5",
color: "#0CC7FA",
},
]),
},
@ -574,15 +622,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#00C25D",
},
{
offset: 0.35,
color: "#05C269",
color: "#115DD5",
},
{
offset: 1,
color: "#0BC27B",
color: "#0574D0",
},
]),
},
@ -598,42 +642,48 @@ export default {
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: "#05E861",
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#0D7FFB",
},
{
offset: 1,
color: "#0440EB",
},
]),
},
},
],
};
},
data: yaxisData,
},
{
type: "bar",
itemStyle: {
color: "transparent",
},
data: yaxisData,
label: {
normal: {
show: true,
position: "top",
formatter: (e) => {
return e.value === maxValue ? e.value : "";
},
fontSize: 20,
color: "#02C262",
offset: [0, -15],
},
},
data: yaxisData2,
},
{
type: "custom",
name: "今日",
name: "昨日",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [-20, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#0BE73B", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
const xAxisPoint = api.coord([api.value(0), 0]);
const distance = 50;
return {
type: "group",
x: -20,
children: [
{
type: "CubeLeft",
@ -641,23 +691,19 @@ export default {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0] - distance,
x: location[0],
y: location[1],
xAxisPoint: [xAxisPoint[0] - distance, xAxisPoint[1]],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#10C6FF",
},
{
offset: 0.35,
color: "#377DFF",
color: "#09E63A",
},
{
offset: 1,
color: "#4464FF",
color: "#39E7C7",
},
]),
},
@ -668,23 +714,19 @@ export default {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0] - distance,
x: location[0],
y: location[1],
xAxisPoint: [xAxisPoint[0] - distance, xAxisPoint[1]],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#0673D5",
},
{
offset: 0.35,
color: "#0B68D5",
color: "#00C35A",
},
{
offset: 1,
color: "#115DD5",
color: "#09C379",
},
]),
},
@ -695,41 +737,30 @@ export default {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0] - distance,
x: location[0],
y: location[1],
xAxisPoint: [xAxisPoint[0] - distance, xAxisPoint[1]],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: "#0964FF",
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#05E6A5",
},
{
offset: 1,
color: "#12DE63",
},
]),
},
},
],
};
},
data: yaxisData2,
},
{
type: "bar",
itemStyle: {
color: "transparent",
},
data: yaxisData2,
label: {
normal: {
show: true,
position: "top",
formatter: (e) => {
return e.value === maxValue2 ? e.value : "";
},
fontSize: 20,
color: "#3286FF",
offset: [0, -15],
},
},
data: yaxisData,
},
],
};
this.defineEcharts("pdsydl", option);
},
// addMessageListener() {
@ -760,7 +791,8 @@ export default {
height: 100%;
box-sizing: border-box;
background-color: transparent;
background-image: url(../../../assets/img/左遮罩.png), url(../../../assets/img/右遮罩.png);
background-image: url(../../../assets/img/左遮罩.png),
url(../../../assets/img/右遮罩.png);
display: flex;
justify-content: space-between;
position: relative;

View File

@ -10,7 +10,9 @@
<p>{{ $route.query.type }}实时电荷</p>
</div>
<div class="data">
<span :class="res == '年' ? 'active' : ''" @click="res = '年'"
<span
:class="res == '年' ? 'active' : ''"
@click="(res = '年'), change()"
></span
>
<span :class="res == '月' ? 'active' : ''" @click="res = '月'"
@ -174,7 +176,6 @@
</template>
<script>
import * as echarts from "echarts";
import highcharts from "highcharts";
export default {
data() {
return {
@ -469,6 +470,10 @@ export default {
},
},
methods: {
change() {
this.option1.xAxis.data = ["1月", "2月", "3月", "4月"];
this.defineEcharts("pdsssdh", this.option1);
},
defineEcharts(dom, option) {
var chartDom = document.getElementById(dom);
var myChart = this.$echarts.init(chartDom);
@ -559,12 +564,14 @@ export default {
data: [
{
name: "昨日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
},
{
name: "今日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
@ -638,106 +645,6 @@ export default {
},
},
series: [
{
type: "custom",
name: "昨日",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [-20, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#0BE73B", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
x: -20,
children: [
{
type: "CubeLeft",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#09E63A",
},
{
offset: 1,
color: "#39E7C7",
},
]),
},
},
{
type: "CubeRight",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#00C35A",
},
{
offset: 1,
color: "#09C379",
},
]),
},
},
{
type: "CubeTop",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#05E6A5",
},
{
offset: 1,
color: "#12DE63",
},
]),
},
},
],
};
},
data: yaxisData,
},
{
type: "custom",
name: "今日",
@ -838,6 +745,106 @@ export default {
},
data: yaxisData2,
},
{
type: "custom",
name: "昨日",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [-20, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#0BE73B", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
x: -20,
children: [
{
type: "CubeLeft",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#09E63A",
},
{
offset: 1,
color: "#39E7C7",
},
]),
},
},
{
type: "CubeRight",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#00C35A",
},
{
offset: 1,
color: "#09C379",
},
]),
},
},
{
type: "CubeTop",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0],
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#05E6A5",
},
{
offset: 1,
color: "#12DE63",
},
]),
},
},
],
};
},
data: yaxisData,
},
],
};
this.defineEcharts("pdsydl", option);

View File

@ -495,10 +495,13 @@ export default {
},
// 3d
yysl() {
const offsetX = 24; //bar
const offsetY = 8; //
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
const offsetX = 20;
const offsetY = 10;
//
const CubeLeft = this.$echarts.graphic.extendShape({
const CubeLeft = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -520,7 +523,7 @@ export default {
},
});
//
const CubeRight = this.$echarts.graphic.extendShape({
const CubeRight = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -540,16 +543,15 @@ export default {
},
});
//
const CubeTop = this.$echarts.graphic.extendShape({
const CubeTop = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const c1 = [shape.x, shape.y];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
// const c3 = [shape.x, shape.y - offsetX];
const c3 = [shape.x, shape.y - offsetY * 2];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
const c3 = [shape.x, shape.y - offsetX];
const c4 = [shape.x - offsetX, shape.y - offsetY];
ctx
.moveTo(c1[0], c1[1])
@ -560,75 +562,78 @@ export default {
},
});
//
this.$echarts.graphic.registerShape("CubeLeft", CubeLeft);
this.$echarts.graphic.registerShape("CubeRight", CubeRight);
this.$echarts.graphic.registerShape("CubeTop", CubeTop);
let xAxisData = ["1月", "2月", "3月", "4月", "5月"];
let seriesData = [100, 200, 300, 400, 300];
//
const maxValue = Math.max(...seriesData);
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
let colorArr = [
["#0A67FF"],
["#10C6FF", "rgba(60,113,255,1)"],
["#0774D6", "rgba(17,94,213,1)"],
];
let option = {
// legend: {
// data: [
// {
// icon: "rect",
// name: "",
// },
// ],
// textStyle: {
// color: "#fff",
// fontSize: "20px",
// },
// },
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params, ticket, callback) {
const item = params[1];
return item.name + " : " + item.value;
},
const option = {
legend: {
data: [
{
name: "月用煤量",
textStyle: {
color: "white",
fontSize: 20,
},
itemStyle: {
color: "#0E62D5", //
},
},
],
},
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
// },
// // formatter: function (params) {
// // const item = params[1]
// // return item.name + ' : ' + item.value
// // }
// },
grid: {
//
left: "5%",
right: "5%",
bottom: "0%",
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
data: xAxisData,
axisLine: {
data: xaxisData,
axisLabel: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
axisTick: {
show: false,
},
axisLabel: {
fontSize: 20,
color: "#fff",
margin: 15,
show: true,
},
},
yAxis: {
type: "value",
name: "单位:t",
splitArea: false,
name: "单位:kWh",
nameTextStyle: {
color: "#fff",
fontSize: 20,
padding: 10,
},
axisLine: {
show: false,
lineStyle: {
width: 2,
color: "#CEDDF2",
},
},
splitLine: {
show: true,
lineStyle: {},
lineStyle: {
color: "#2A353F",
type: "dashed",
},
},
axisTick: {
show: false,
@ -639,17 +644,35 @@ export default {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
// boundaryGap: ['20%', '20%'],
},
series: [
{
name: "月用煤量",
type: "custom",
name: "炭排放量",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [25, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#3F71FE", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
x: 30,
children: [
{
type: "CubeLeft",
@ -665,11 +688,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[1][0],
color: "#4567FF",
},
{
offset: 1,
color: colorArr[1][1],
color: "#0CC7FA",
},
]),
},
@ -688,11 +711,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[2][0],
color: "#115DD5",
},
{
offset: 1,
color: colorArr[2][1],
color: "#0574D0",
},
]),
},
@ -711,11 +734,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[0][0],
color: "#0D7FFB",
},
{
offset: 1,
color: colorArr[0][0],
color: "#0440EB",
},
]),
},
@ -723,27 +746,7 @@ export default {
],
};
},
data: seriesData,
},
{
type: "bar",
label: {
normal: {
show: true,
position: "top",
formatter: (e) => {
return e.value === maxValue ? e.value : "";
},
fontSize: 20,
color: "#11C3FF",
offset: [0, -15],
},
},
itemStyle: {
color: "transparent",
},
tooltip: {},
data: seriesData,
data: yaxisData,
},
],
};
@ -765,7 +768,8 @@ export default {
height: 100%;
box-sizing: border-box;
background-color: transparent;
background-image: url(../../assets/img/左遮罩.png), url(../../assets/img/右遮罩.png);
background-image: url(../../assets/img/左遮罩.png),
url(../../assets/img/右遮罩.png);
display: flex;
padding-top: 400px;
justify-content: space-between;

View File

@ -425,10 +425,13 @@ export default {
},
//
yysl() {
const offsetX = 24; //bar
const offsetY = 8; //
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
const offsetX = 20;
const offsetY = 10;
//
const CubeLeft = this.$echarts.graphic.extendShape({
const CubeLeft = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -450,7 +453,7 @@ export default {
},
});
//
const CubeRight = this.$echarts.graphic.extendShape({
const CubeRight = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -470,16 +473,15 @@ export default {
},
});
//
const CubeTop = this.$echarts.graphic.extendShape({
const CubeTop = echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
},
buildPath: function (ctx, shape) {
const c1 = [shape.x, shape.y];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
// const c3 = [shape.x, shape.y - offsetX];
const c3 = [shape.x, shape.y - offsetY * 2];
const c2 = [shape.x + offsetX, shape.y - offsetY]; //
const c3 = [shape.x, shape.y - offsetX];
const c4 = [shape.x - offsetX, shape.y - offsetY];
ctx
.moveTo(c1[0], c1[1])
@ -490,75 +492,78 @@ export default {
},
});
//
this.$echarts.graphic.registerShape("CubeLeft", CubeLeft);
this.$echarts.graphic.registerShape("CubeRight", CubeRight);
this.$echarts.graphic.registerShape("CubeTop", CubeTop);
let xAxisData = ["1月", "2月", "3月", "4月", "5月"];
let seriesData = [100, 200, 300, 400, 300];
//
const maxValue = Math.max(...seriesData);
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
let colorArr = [
["#0A67FF"],
["#10C6FF", "rgba(60,113,255,1)"],
["#0774D6", "rgba(17,94,213,1)"],
];
let option = {
// legend: {
// data: [
// {
// icon: "rect",
// name: "",
// },
// ],
// textStyle: {
// color: "#fff",
// fontSize: "20px",
// },
// },
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params, ticket, callback) {
const item = params[1];
return item.name + " : " + item.value;
},
const option = {
legend: {
data: [
{
name: "月用水量",
textStyle: {
color: "white",
fontSize: 20,
},
itemStyle: {
color: "#0E62D5", //
},
},
],
},
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
// },
// // formatter: function (params) {
// // const item = params[1]
// // return item.name + ' : ' + item.value
// // }
// },
grid: {
//
left: "5%",
right: "5%",
bottom: "0%",
left: "3%",
right: "4%",
bottom: "3%",
containLabel: true,
},
xAxis: {
type: "category",
data: xAxisData,
axisLine: {
data: xaxisData,
axisLabel: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
axisTick: {
show: false,
},
axisLabel: {
fontSize: 20,
color: "#fff",
margin: 15,
show: true,
},
},
yAxis: {
type: "value",
name: "单位:t",
splitArea: false,
name: "单位:kWh",
nameTextStyle: {
color: "#fff",
fontSize: 20,
padding: 10,
},
axisLine: {
show: false,
lineStyle: {
width: 2,
color: "#CEDDF2",
},
},
splitLine: {
show: true,
lineStyle: {},
lineStyle: {
color: "#2A353F",
type: "dashed",
},
},
axisTick: {
show: false,
@ -569,13 +574,30 @@ export default {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
// boundaryGap: ['20%', '20%'],
},
series: [
{
name: "月用水量",
type: "custom",
name: "炭排放量",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [0, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#3F71FE", //
fontSize: 25,
},
},
],
},
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
@ -595,11 +617,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[1][0],
color: "#4567FF",
},
{
offset: 1,
color: colorArr[1][1],
color: "#0CC7FA",
},
]),
},
@ -618,11 +640,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[2][0],
color: "#115DD5",
},
{
offset: 1,
color: colorArr[2][1],
color: "#0574D0",
},
]),
},
@ -641,11 +663,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr[0][0],
color: "#0D7FFB",
},
{
offset: 1,
color: colorArr[0][0],
color: "#0440EB",
},
]),
},
@ -653,27 +675,7 @@ export default {
],
};
},
data: seriesData,
},
{
type: "bar",
label: {
normal: {
show: true,
position: "top",
formatter: (e) => {
return e.value === maxValue ? e.value : "";
},
fontSize: 20,
color: "#11C3FF",
offset: [0, -15],
},
},
itemStyle: {
color: "transparent",
},
tooltip: {},
data: seriesData,
data: yaxisData,
},
],
};
@ -695,7 +697,8 @@ export default {
height: 100%;
box-sizing: border-box;
background-color: transparent;
background-image: url(../../assets/img/左遮罩.png), url(../../assets/img/右遮罩.png);
background-image: url(../../assets/img/左遮罩.png),
url(../../assets/img/右遮罩.png);
display: flex;
padding-top: 400px;
justify-content: space-between;

View File

@ -87,77 +87,78 @@ export default {
});
},
changeArr(name) {
this.arr[0] = {
url: require(`../../assets/tpt/${name}.png`),
srcList: [require(`../../assets/tpt/${name}.png`)],
};
// if (name == "") {
// } else if (name == "") {
// this.arr[0] = {
// url: require("../../assets/tpt/.png"),
// srcList: [require("../../assets/tpt/.png")],
// };
// } else if (name == "") {
// this.arr[0] = {
// url: require("../../assets/tpt/.png"),
// srcList: [require("../../assets/tpt/.png")],
// };
// } else if (name == "线") {
// this.arr[0] = {
// url: require("../../assets/tpt/线.png"),
// srcList: [require("../../assets/tpt/线.png")],
// };
// } else if (name == "线") {
// this.arr[0] = {
// url: require("../../assets/tpt/线.png"),
// srcList: [require("../../assets/tpt/线.png")],
// };
// } else if (name == "") {
// this.arr[0] = {
// url: require("../../assets/tpt/.png"),
// srcList: [require("../../assets/tpt/.png")],
// };
// } else if (name == "线1") {
// this.arr[0] = {
// url: require("../../assets/tpt/线1.png"),
// srcList: [require("../../assets/tpt/线1.png")],
// };
// } else if (name == "线2") {
// this.arr[0] = {
// url: require("../../assets/tpt/线2.png"),
// srcList: [require("../../assets/tpt/线2.png")],
// };
// } else if (name == "线1") {
// this.arr[0] = {
// url: require("../../assets/tpt/线1.png"),
// srcList: [require("../../assets/tpt/线1.png")],
// };
// } else if (name == "线2") {
// this.arr[0] = {
// url: require("../../assets/tpt/线2.png"),
// srcList: [require("../../assets/tpt/线2.png")],
// };
// } else if (name == "线") {
// this.arr[0] = {
// url: require("../../assets/tpt/线.png"),
// srcList: [require("../../assets/tpt/线.png")],
// };
// } else if (name == "") {
// this.arr[0] = {
// url: require("../../assets/tpt/.png"),
// srcList: [require("../../assets/tpt/.png")],
// };
// } else if (name == "") {
// this.arr[0] = {
// url: require("../../assets/tpt/.png"),
// srcList: [require("../../assets/tpt/.png")],
// };
// } else if (name == "") {
// this.arr[0] = {
// url: require("../../assets/tpt/.png"),
// srcList: [require("../../assets/tpt/.png")],
// };
// }
// var url = require("../../assets/tpt/" + name + ".png");
// this.arr[0] = {
// url: url,
// srcList: [url],
// };
if (name == "总降电力室") {
} else if (name == "矿山电力室") {
this.arr[0] = {
url: require("../../assets/tpt/矿山电力室.png"),
srcList: [require("../../assets/tpt/矿山电力室.png")],
};
} else if (name == "原材料电力室") {
this.arr[0] = {
url: require("../../assets/tpt/原材料电力室.png"),
srcList: [require("../../assets/tpt/原材料电力室.png")],
};
} else if (name == "一线生料磨电力室") {
this.arr[0] = {
url: require("../../assets/tpt/一线生料电力室.png"),
srcList: [require("../../assets/tpt/一线生料电力室.png")],
};
} else if (name == "二线生料磨电力室") {
this.arr[0] = {
url: require("../../assets/tpt/二线生料电力室.png"),
srcList: [require("../../assets/tpt/二线生料电力室.png")],
};
} else if (name == "窑尾电力室") {
this.arr[0] = {
url: require("../../assets/tpt/窑尾电力室.png"),
srcList: [require("../../assets/tpt/窑尾电力室.png")],
};
} else if (name == "一线窑头电力室1") {
this.arr[0] = {
url: require("../../assets/tpt/一线窑头电力室1.png"),
srcList: [require("../../assets/tpt/一线窑头电力室1.png")],
};
} else if (name == "一线窑头电力室2") {
this.arr[0] = {
url: require("../../assets/tpt/一线窑头电力室2.png"),
srcList: [require("../../assets/tpt/一线窑头电力室2.png")],
};
} else if (name == "二线窑头电力室1") {
this.arr[0] = {
url: require("../../assets/tpt/二线窑头电力室1.png"),
srcList: [require("../../assets/tpt/二线窑头电力室1.png")],
};
} else if (name == "二线窑头电力室2") {
this.arr[0] = {
url: require("../../assets/tpt/二线窑头电力室2.png"),
srcList: [require("../../assets/tpt/二线窑头电力室2.png")],
};
} else if (name == "一线原煤电力室") {
this.arr[0] = {
url: require("../../assets/tpt/一线原煤电力室.png"),
srcList: [require("../../assets/tpt/一线原煤电力室.png")],
};
} else if (name == "水泥磨电力室") {
this.arr[0] = {
url: require("../../assets/tpt/水泥磨电力室.png"),
srcList: [require("../../assets/tpt/水泥磨电力室.png")],
};
} else if (name == "万吨仓电力室") {
this.arr[0] = {
url: require("../../assets/tpt/万吨仓电力室.png"),
srcList: [require("../../assets/tpt/万吨仓电力室.png")],
};
} else if (name == "余热发电电力室") {
this.arr[0] = {
url: require("../../assets/tpt/余热发电电力室.png"),
srcList: [require("../../assets/tpt/余热发电电力室.png")],
};
}
//
// else if (name == "线") {
// this.arr[0] = {
@ -323,7 +324,7 @@ export default {
width: 317px;
height: 485px;
position: absolute;
left: 50%;
left: 52.5%;
top: 50%;
// border: 2px solid #20d6fe;
transform: translate(50%, -50%);