Compare commits

..

No commits in common. "a6caa1ea6ba3254bf049174f95b40d5a305a7f2a" and "dcece1e2f9bb99538b79b693bd14d5047e5943e6" have entirely different histories.

10 changed files with 524 additions and 555 deletions

13
package-lock.json generated
View File

@ -30,6 +30,7 @@
"@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"
@ -8021,6 +8022,12 @@
"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",
@ -19178,6 +19185,12 @@
"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,6 +29,7 @@
"@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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

View File

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

View File

@ -404,9 +404,11 @@ export default {
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
let yaxisData2 = [60, 56, 34, 69, 79];
const offsetX = 20;
const offsetY = 10;
//
const maxValue = Math.max(...yaxisData);
const maxValue2 = Math.max(...yaxisData2);
const offsetX = 15;
const offsetY = 5;
//
const CubeLeft = echarts.graphic.extendShape({
shape: {
@ -416,7 +418,6 @@ 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];
@ -429,6 +430,7 @@ export default {
.closePath();
},
});
//
const CubeRight = echarts.graphic.extendShape({
shape: {
@ -449,6 +451,7 @@ export default {
.closePath();
},
});
//
const CubeTop = echarts.graphic.extendShape({
shape: {
@ -457,7 +460,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
@ -468,122 +471,67 @@ export default {
.closePath();
},
});
//
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
const option = {
let option = {
legend: {
data: [
{
name: "昨日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
},
{
name: "今日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
},
{ icon: "rect", name: "昨日" },
{ icon: "rect", name: "今日" },
],
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: "3%",
right: "4%",
bottom: "3%",
left: "1%",
right: "0%",
top: "16%",
bottom: "5%",
containLabel: true,
},
xAxis: {
type: "category",
data: xaxisData,
axisLabel: {
axisLine: {
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: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
fontSize: 20,
color: "#FFFFFF",
},
},
series: [
{
type: "custom",
name: "今日",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [25, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#24BDF2", //
fontSize: 25,
},
},
],
},
name: "昨日",
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
type: "group",
x: 30,
children: [
{
type: "CubeLeft",
@ -599,11 +547,15 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#4567FF",
color: "#08E83C",
},
{
offset: 0.35,
color: "#1FE77D",
},
{
offset: 1,
color: "#0CC7FA",
color: "#38E7C5",
},
]),
},
@ -622,11 +574,15 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#115DD5",
color: "#00C25D",
},
{
offset: 0.35,
color: "#05C269",
},
{
offset: 1,
color: "#0574D0",
color: "#0BC27B",
},
]),
},
@ -641,126 +597,139 @@ export default {
y: location[1],
xAxisPoint: api.coord([api.value(0), 0]),
},
style: {
fill: "#05E861",
},
},
],
};
},
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],
},
},
},
{
type: "custom",
name: "今日",
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",
children: [
{
type: "CubeLeft",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0] - distance,
y: location[1],
xAxisPoint: [xAxisPoint[0] - distance, xAxisPoint[1]],
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#0D7FFB",
color: "#10C6FF",
},
{
offset: 0.35,
color: "#377DFF",
},
{
offset: 1,
color: "#0440EB",
color: "#4464FF",
},
]),
},
},
{
type: "CubeRight",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0] - distance,
y: location[1],
xAxisPoint: [xAxisPoint[0] - distance, xAxisPoint[1]],
},
style: {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#0673D5",
},
{
offset: 0.35,
color: "#0B68D5",
},
{
offset: 1,
color: "#115DD5",
},
]),
},
},
{
type: "CubeTop",
shape: {
api,
xValue: api.value(0),
yValue: api.value(1),
x: location[0] - distance,
y: location[1],
xAxisPoint: [xAxisPoint[0] - distance, xAxisPoint[1]],
},
style: {
fill: "#0964FF",
},
},
],
};
},
data: yaxisData2,
},
{
type: "custom",
name: "昨日",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [-20, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#0BE73B", //
fontSize: 25,
},
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],
},
},
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);
},
// addMessageListener() {
@ -791,8 +760,7 @@ 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,9 +10,7 @@
<p>{{ $route.query.type }}实时电荷</p>
</div>
<div class="data">
<span
:class="res == '年' ? 'active' : ''"
@click="(res = '年'), change()"
<span :class="res == '年' ? 'active' : ''" @click="res = '年'"
></span
>
<span :class="res == '月' ? 'active' : ''" @click="res = '月'"
@ -176,6 +174,7 @@
</template>
<script>
import * as echarts from "echarts";
import highcharts from "highcharts";
export default {
data() {
return {
@ -470,10 +469,6 @@ 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);
@ -564,14 +559,12 @@ export default {
data: [
{
name: "昨日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
},
{
name: "今日",
// icon: require("../../../assets/nyjc/.png"),
textStyle: {
color: "white",
},
@ -645,106 +638,6 @@ export default {
},
},
series: [
{
type: "custom",
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",
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: "#4567FF",
},
{
offset: 1,
color: "#0CC7FA",
},
]),
},
},
{
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: "#115DD5",
},
{
offset: 1,
color: "#0574D0",
},
]),
},
},
{
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: "#0D7FFB",
},
{
offset: 1,
color: "#0440EB",
},
]),
},
},
],
};
},
data: yaxisData2,
},
{
type: "custom",
name: "昨日",
@ -845,6 +738,106 @@ export default {
},
data: yaxisData,
},
{
type: "custom",
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",
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: "#4567FF",
},
{
offset: 1,
color: "#0CC7FA",
},
]),
},
},
{
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: "#115DD5",
},
{
offset: 1,
color: "#0574D0",
},
]),
},
},
{
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: "#0D7FFB",
},
{
offset: 1,
color: "#0440EB",
},
]),
},
},
],
};
},
data: yaxisData2,
},
],
};
this.defineEcharts("pdsydl", option);

View File

@ -495,13 +495,10 @@ export default {
},
// 3d
yysl() {
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
const offsetX = 20;
const offsetY = 10;
const offsetX = 24; //bar
const offsetY = 8; //
//
const CubeLeft = echarts.graphic.extendShape({
const CubeLeft = this.$echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -523,7 +520,7 @@ export default {
},
});
//
const CubeRight = echarts.graphic.extendShape({
const CubeRight = this.$echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -543,15 +540,16 @@ export default {
},
});
//
const CubeTop = echarts.graphic.extendShape({
const CubeTop = this.$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 c2 = [shape.x + offsetX, shape.y - offsetY]; //
// const c3 = [shape.x, shape.y - offsetX];
const c3 = [shape.x, shape.y - offsetY * 2];
const c4 = [shape.x - offsetX, shape.y - offsetY];
ctx
.moveTo(c1[0], c1[1])
@ -562,78 +560,75 @@ export default {
},
});
//
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
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);
const option = {
legend: {
data: [
{
name: "月用煤量",
textStyle: {
color: "white",
fontSize: 20,
},
itemStyle: {
color: "#0E62D5", //
},
},
],
},
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
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",
// },
// // formatter: function (params) {
// // const item = params[1]
// // return item.name + ' : ' + item.value
// // }
// },
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params, ticket, callback) {
const item = params[1];
return item.name + " : " + item.value;
},
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
//
left: "5%",
right: "5%",
bottom: "0%",
containLabel: true,
},
xAxis: {
type: "category",
data: xaxisData,
axisLabel: {
data: xAxisData,
axisLine: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
axisTick: {
show: true,
show: false,
},
axisLabel: {
fontSize: 20,
color: "#fff",
margin: 15,
},
},
yAxis: {
type: "value",
splitArea: false,
name: "单位:kWh",
name: "单位:t",
nameTextStyle: {
color: "#fff",
fontSize: 20,
padding: 10,
},
axisLine: {
show: false,
lineStyle: {
width: 2,
color: "#CEDDF2",
},
},
splitLine: {
show: true,
lineStyle: {
color: "#2A353F",
type: "dashed",
},
lineStyle: {},
},
axisTick: {
show: false,
@ -644,30 +639,13 @@ export default {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
// boundaryGap: ['20%', '20%'],
},
series: [
{
name: "月用煤量",
type: "custom",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [25, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#3F71FE", //
fontSize: 25,
},
},
],
},
name: "炭排放量",
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
@ -687,11 +665,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#4567FF",
color: colorArr[1][0],
},
{
offset: 1,
color: "#0CC7FA",
color: colorArr[1][1],
},
]),
},
@ -710,11 +688,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#115DD5",
color: colorArr[2][0],
},
{
offset: 1,
color: "#0574D0",
color: colorArr[2][1],
},
]),
},
@ -733,11 +711,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#0D7FFB",
color: colorArr[0][0],
},
{
offset: 1,
color: "#0440EB",
color: colorArr[0][0],
},
]),
},
@ -745,7 +723,27 @@ export default {
],
};
},
data: yaxisData,
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,
},
],
};
@ -767,8 +765,7 @@ 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,13 +425,10 @@ export default {
},
//
yysl() {
let xaxisData = ["1月", "2月", "3月", "4月", "5月"];
let yaxisData = [90, 80, 100, 70, 65];
const offsetX = 20;
const offsetY = 10;
const offsetX = 24; //bar
const offsetY = 8; //
//
const CubeLeft = echarts.graphic.extendShape({
const CubeLeft = this.$echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -453,7 +450,7 @@ export default {
},
});
//
const CubeRight = echarts.graphic.extendShape({
const CubeRight = this.$echarts.graphic.extendShape({
shape: {
x: 0,
y: 0,
@ -473,15 +470,16 @@ export default {
},
});
//
const CubeTop = echarts.graphic.extendShape({
const CubeTop = this.$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 c2 = [shape.x + offsetX, shape.y - offsetY]; //
// const c3 = [shape.x, shape.y - offsetX];
const c3 = [shape.x, shape.y - offsetY * 2];
const c4 = [shape.x - offsetX, shape.y - offsetY];
ctx
.moveTo(c1[0], c1[1])
@ -492,78 +490,75 @@ export default {
},
});
//
echarts.graphic.registerShape("CubeLeft", CubeLeft);
echarts.graphic.registerShape("CubeRight", CubeRight);
echarts.graphic.registerShape("CubeTop", CubeTop);
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);
const option = {
legend: {
data: [
{
name: "月用水量",
textStyle: {
color: "white",
fontSize: 20,
},
itemStyle: {
color: "#0E62D5", //
},
},
],
},
// tooltip: {
// trigger: "axis",
// axisPointer: {
// type: "shadow",
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",
// },
// // formatter: function (params) {
// // const item = params[1]
// // return item.name + ' : ' + item.value
// // }
// },
tooltip: {
trigger: "axis",
axisPointer: {
type: "shadow",
},
formatter: function (params, ticket, callback) {
const item = params[1];
return item.name + " : " + item.value;
},
},
grid: {
left: "3%",
right: "4%",
bottom: "3%",
//
left: "5%",
right: "5%",
bottom: "0%",
containLabel: true,
},
xAxis: {
type: "category",
data: xaxisData,
axisLabel: {
data: xAxisData,
axisLine: {
show: true,
textStyle: {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
axisTick: {
show: true,
show: false,
},
axisLabel: {
fontSize: 20,
color: "#fff",
margin: 15,
},
},
yAxis: {
type: "value",
splitArea: false,
name: "单位:kWh",
name: "单位:t",
nameTextStyle: {
color: "#fff",
fontSize: 20,
padding: 10,
},
axisLine: {
show: false,
lineStyle: {
width: 2,
color: "#CEDDF2",
},
},
splitLine: {
show: true,
lineStyle: {
color: "#2A353F",
type: "dashed",
},
lineStyle: {},
},
axisTick: {
show: false,
@ -574,30 +569,13 @@ export default {
color: "#fff",
fontSize: 20,
},
interval: 0, //x
},
// boundaryGap: ['20%', '20%'],
},
series: [
{
name: "月用水量",
type: "custom",
markPoint: {
data: [
{
type: "max",
name: "Max",
symbolOffset: [0, 0],
itemStyle: {
color: "transparent", //
},
// label
label: {
color: "#3F71FE", //
fontSize: 25,
},
},
],
},
name: "炭排放量",
renderItem: (params, api) => {
const location = api.coord([api.value(0), api.value(1)]);
return {
@ -617,11 +595,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#4567FF",
color: colorArr[1][0],
},
{
offset: 1,
color: "#0CC7FA",
color: colorArr[1][1],
},
]),
},
@ -640,11 +618,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#115DD5",
color: colorArr[2][0],
},
{
offset: 1,
color: "#0574D0",
color: colorArr[2][1],
},
]),
},
@ -663,11 +641,11 @@ export default {
fill: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#0D7FFB",
color: colorArr[0][0],
},
{
offset: 1,
color: "#0440EB",
color: colorArr[0][0],
},
]),
},
@ -675,7 +653,27 @@ export default {
],
};
},
data: yaxisData,
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,
},
],
};
@ -697,8 +695,7 @@ 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;