|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<!-- 支架压力柱状图 -->
|
|
<!-- 支架压力柱状图 -->
|
|
- <div id="bar" style="height: 300px; width: 600px"></div>
|
|
|
|
|
|
+ <div id="bar" style="height: 300px; width: 600px;margin-top:10px"></div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
@@ -10,6 +10,14 @@ export default {
|
|
return {
|
|
return {
|
|
myChart: null,
|
|
myChart: null,
|
|
option: {
|
|
option: {
|
|
|
|
+ title: {
|
|
|
|
+ text: '支架压力监控',
|
|
|
|
+ padding: [5, 230],
|
|
|
|
+ textStyle: {
|
|
|
|
+ fontWeight: "normal", //标题颜色
|
|
|
|
+ color: "#4ADEFE",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
tooltip: {
|
|
tooltip: {
|
|
trigger: "axis",
|
|
trigger: "axis",
|
|
axisPointer: {
|
|
axisPointer: {
|
|
@@ -25,12 +33,23 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- color: ["red", "green", "yellow"],
|
|
|
|
|
|
+ color: ["#FF6666", "#99CC66", "#FFFF66"],
|
|
|
|
+ // legend: {
|
|
|
|
+ // orient: "vertical",
|
|
|
|
+ // x: "left",
|
|
|
|
+ // y: "top",
|
|
|
|
+ // data: ["压力超限", "压力过低", "压力正常"],
|
|
|
|
+ // textStyle: {
|
|
|
|
+ // fontWeight: "normal",
|
|
|
|
+ // color: "#fff",
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
legend: {
|
|
legend: {
|
|
|
|
+ orient: "vertical",
|
|
left: "right",
|
|
left: "right",
|
|
icon: "rect",
|
|
icon: "rect",
|
|
textStyle: {
|
|
textStyle: {
|
|
- color: "#000",
|
|
|
|
|
|
+ color: "#fff",
|
|
},
|
|
},
|
|
data: ["压力超限", "压力过低", "压力正常"],
|
|
data: ["压力超限", "压力过低", "压力正常"],
|
|
},
|
|
},
|
|
@@ -43,15 +62,34 @@ export default {
|
|
xAxis: [
|
|
xAxis: [
|
|
{
|
|
{
|
|
type: "category",
|
|
type: "category",
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: "#fff",
|
|
|
|
+ fontSize: 11,
|
|
|
|
+ },
|
|
|
|
+ axisLine: {
|
|
|
|
+ show: true,
|
|
|
|
+ },
|
|
data: [
|
|
data: [
|
|
198, 190, 180, 170, 160, 150, 140, 130, 120, 110, 100, 90, 80, 70,
|
|
198, 190, 180, 170, 160, 150, 140, 130, 120, 110, 100, 90, 80, 70,
|
|
60, 50, 40, 30, 20, 10, 1,
|
|
60, 50, 40, 30, 20, 10, 1,
|
|
],
|
|
],
|
|
|
|
+
|
|
},
|
|
},
|
|
],
|
|
],
|
|
yAxis: [
|
|
yAxis: [
|
|
{
|
|
{
|
|
type: "value",
|
|
type: "value",
|
|
|
|
+ axisLabel: {
|
|
|
|
+ color: "#fff",
|
|
|
|
+ fontSize: 11,
|
|
|
|
+ },
|
|
|
|
+ splitLine: {
|
|
|
|
+ show: true,
|
|
|
|
+ lineStyle: {
|
|
|
|
+ type: "dotted",
|
|
|
|
+ color: "#fff",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
},
|
|
},
|
|
],
|
|
],
|
|
series: [
|
|
series: [
|
|
@@ -62,11 +100,11 @@ export default {
|
|
normal: {
|
|
normal: {
|
|
color: function (params) {
|
|
color: function (params) {
|
|
if (params.data > 64) {
|
|
if (params.data > 64) {
|
|
- return "red";
|
|
|
|
|
|
+ return "#FF6666";
|
|
} else if (params.data < 24) {
|
|
} else if (params.data < 24) {
|
|
- return "yellow";
|
|
|
|
|
|
+ return "#FFFF66";
|
|
} else {
|
|
} else {
|
|
- return "green";
|
|
|
|
|
|
+ return "#99CC66";
|
|
}
|
|
}
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -90,7 +128,7 @@ export default {
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
show: true,
|
|
show: true,
|
|
- color: "red",
|
|
|
|
|
|
+ color: "#FF6666",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
@@ -109,7 +147,7 @@ export default {
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
show: true,
|
|
show: true,
|
|
- color: "yellow",
|
|
|
|
|
|
+ color: "#FFFF66",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|