|
@@ -0,0 +1,326 @@
|
|
|
+<template>
|
|
|
+ <div class="main">
|
|
|
+ <div ref="testLine" style="height: 170px; width: 300px"></div>
|
|
|
+ <div style="display: flex; flex-flow: column">
|
|
|
+ <div class="botton1">
|
|
|
+ <span class="name">1235 /m</span>
|
|
|
+ <span class="value">本月煤巷掘进</span>
|
|
|
+ </div>
|
|
|
+ <div class="botton2">
|
|
|
+ <span class="name">5690 /m</span>
|
|
|
+ <span class="value">本月岩巷掘进</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ currentChartId: 1,
|
|
|
+ xData: new Array(30).fill("-"),
|
|
|
+ y1Data: new Array(30).fill("-"),
|
|
|
+ y2Data: new Array(30).fill("-"),
|
|
|
+ count: 0,
|
|
|
+ myChart: null,
|
|
|
+ option: {
|
|
|
+ tooltip: {
|
|
|
+ trigger: "axis",
|
|
|
+ backgroundColor: "transparent",
|
|
|
+ axisPointer: {
|
|
|
+ lineStyle: {
|
|
|
+ color: {
|
|
|
+ type: "linear",
|
|
|
+ x: 0,
|
|
|
+ y: 0,
|
|
|
+ x2: 0,
|
|
|
+ y2: 1,
|
|
|
+ colorStops: [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: "rgba(126,199,255,0)", // 0% 处的颜色
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 0.5,
|
|
|
+ color: "rgba(126,199,255,1)", // 100% 处的颜色
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: "rgba(126,199,255,0)", // 100% 处的颜色
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ global: false, // 缺省为 false
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ formatter: (p) => {
|
|
|
+ let dom = `<div style="width: 79px;
|
|
|
+ height: 110px;;color:#fff;position: relative;">
|
|
|
+ <svg style="position: absolute;top: 50%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%) translateY(-50%);" class="svg" xmlns="http://www.w3.org/2000/svg" width="100"
|
|
|
+ height="111" viewBox="0 0 80 85">
|
|
|
+ <defs>
|
|
|
+ <style>
|
|
|
+ .cls-1 {
|
|
|
+ fill: #07172c;
|
|
|
+ fill-opacity: 0.8;
|
|
|
+ stroke: #a7d8ff;
|
|
|
+ stroke-linejoin: round;
|
|
|
+ stroke-opacity: 0.2;
|
|
|
+ stroke-width: 1px;
|
|
|
+ fill-rule: evenodd;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </defs>
|
|
|
+ <path id="矩形_419" data-name="矩形 419" class="cls-1" d="M266,595h74v50H266V624.046L261,620l5-3.984V595Z"
|
|
|
+ transform="translate(-258.5 -592.5)" />
|
|
|
+ </svg>
|
|
|
+ <div style="padding: 3px 1px 3px 11px;display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: column;position: relative;z-index: 1;">
|
|
|
+ <div
|
|
|
+ style="margin-bottom: 4px;width:100%;display:${
|
|
|
+ p[0] ? "flex" : "none"
|
|
|
+ };justify-content:space-between;align-items:center;">
|
|
|
+ <span style="font-size:11px;color:#7ec7ff;">${
|
|
|
+ p[0] ? p[0].seriesName : ""
|
|
|
+ }</span>
|
|
|
+ <span style="font-size:11px;color:#fff;">${p[0] ? p[0].data : ""}</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="width:100%;height:100%;display:${
|
|
|
+ p[1] ? "flex" : "none"
|
|
|
+ };justify-content:space-between;align-items:center;">
|
|
|
+ <span style="font-size:11px;color:#7ec7ff;">${
|
|
|
+ p[1] ? p[1].seriesName : ""
|
|
|
+ }</span>
|
|
|
+ <span style="font-size:11px;color:#fff;">${p[1] ? p[1].data : ""}</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ style="width:100%;height:100%;display:${
|
|
|
+ p[1] ? "flex" : "none"
|
|
|
+ };justify-content:space-between;align-items:center;">
|
|
|
+ <span style="font-size:11px;color:#7ec7ff;">${
|
|
|
+ p[2] ? p[2].seriesName : ""
|
|
|
+ }</span>
|
|
|
+ <span style="font-size:11px;color:#fff;">${p[2] ? p[2].data : ""}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>`;
|
|
|
+ return dom;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ legend: {
|
|
|
+ align: "left",
|
|
|
+ left: "44%",
|
|
|
+ top: "17%",
|
|
|
+ type: "plain",
|
|
|
+ textStyle: {
|
|
|
+ color: "#7ec7ff",
|
|
|
+ fontSize: 11,
|
|
|
+ },
|
|
|
+ // icon:'rect',
|
|
|
+ itemGap: 25,
|
|
|
+ // itemWidth: 18,
|
|
|
+ icon: "path://M0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",
|
|
|
+ data: ["煤巷", "岩巷"],
|
|
|
+ },
|
|
|
+ grid: {
|
|
|
+ top: "22%",
|
|
|
+ left: "3%",
|
|
|
+ right: "4%",
|
|
|
+ bottom: "3%",
|
|
|
+ containLabel: true,
|
|
|
+ },
|
|
|
+ yAxis: [
|
|
|
+ {
|
|
|
+ boundaryGap: [0, "100%"],
|
|
|
+ name: "米",
|
|
|
+ splitLine: {
|
|
|
+ show: true,
|
|
|
+ lineStyle: {
|
|
|
+ type: "dotted",
|
|
|
+ color: "rgba(155, 155, 155, 0.5)",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ axisLabel: {
|
|
|
+ color: "#fff",
|
|
|
+ fontSize: 11,
|
|
|
+ },
|
|
|
+ axisTick: { show: false },
|
|
|
+ type: "value",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ xAxis: [
|
|
|
+ {
|
|
|
+ type: "category",
|
|
|
+ name: "日",
|
|
|
+ axisLabel: {
|
|
|
+ color: "#fff",
|
|
|
+ interval: 0,
|
|
|
+ fontSize: 9,
|
|
|
+ },
|
|
|
+ axisLine: {
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ 1, 3, 5, 7, 9, 10, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31,
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ title: {
|
|
|
+ text: "掘进进尺",
|
|
|
+ // 标题内边距 上下边距 左右边距
|
|
|
+ padding: [10, 0, 0, 110],
|
|
|
+ textStyle: {
|
|
|
+ fontWeight: "bolder", //标题颜色
|
|
|
+ color: "white",
|
|
|
+ fontSize: 18,
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: "煤巷",
|
|
|
+ type: "line",
|
|
|
+ symbol: "circle", // 默认是空心圆(中间是白色的),改成实心圆
|
|
|
+ showAllSymbol: true,
|
|
|
+ symbolSize: 0,
|
|
|
+ smooth: true,
|
|
|
+ lineStyle: {
|
|
|
+ normal: {
|
|
|
+ width: 2,
|
|
|
+ color: "rgba(255, 102, 102,1)", // 线条颜色
|
|
|
+ },
|
|
|
+ borderColor: "rgba(0,0,0,.4)",
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ color: "rgba(255, 102, 102,1)",
|
|
|
+ borderColor: "#646ace",
|
|
|
+ borderWidth: 2,
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ areaStyle: {
|
|
|
+ //区域填充样式
|
|
|
+ normal: {
|
|
|
+ //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
|
|
|
+ color: new echarts.graphic.LinearGradient(
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 1,
|
|
|
+ [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: "rgba(255, 102, 102,.3)",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: "rgba(255, 102, 102, 0)",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ false
|
|
|
+ ),
|
|
|
+ shadowColor: "rgba(255, 102, 102, 0.5)", //阴影颜色
|
|
|
+ shadowBlur: 20, //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ 35, 32, 34, 37, 38, 41, 40, 37, 32, 37, 39, 41, 43, 45, 40, 37,
|
|
|
+ 34, 32, 36, 34, 31, 30, 28, 33, 34, 37, 35, 33, 31, 34, 37,
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: "岩巷",
|
|
|
+ type: "line",
|
|
|
+ symbol: "circle", // 默认是空心圆(中间是白色的),改成实心圆
|
|
|
+ showAllSymbol: true,
|
|
|
+ symbolSize: 0,
|
|
|
+ smooth: true,
|
|
|
+ lineStyle: {
|
|
|
+ normal: {
|
|
|
+ width: 2,
|
|
|
+ color: "rgba(0, 102, 153,1)", // 线条颜色
|
|
|
+ },
|
|
|
+ borderColor: "rgba(0,0,0,.4)",
|
|
|
+ },
|
|
|
+ itemStyle: {
|
|
|
+ color: "rgba(0, 102, 153,1)",
|
|
|
+ borderColor: "#3578e5",
|
|
|
+ borderWidth: 2,
|
|
|
+ },
|
|
|
+ tooltip: {
|
|
|
+ show: true,
|
|
|
+ },
|
|
|
+ areaStyle: {
|
|
|
+ //区域填充样式
|
|
|
+ normal: {
|
|
|
+ //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
|
|
|
+ color: new echarts.graphic.LinearGradient(
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 1,
|
|
|
+ [
|
|
|
+ {
|
|
|
+ offset: 0,
|
|
|
+ color: "rgba(0, 102, 153,.3)",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ offset: 1,
|
|
|
+ color: "rgba(0, 102, 153, 0)",
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ false
|
|
|
+ ),
|
|
|
+ shadowColor: "rgba(0, 102, 153, 0.5)", //阴影颜色
|
|
|
+ shadowBlur: 20, //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ 23, 25, 26, 28, 25, 26, 25, 25, 27, 28, 31, 31, 33, 35, 30, 32,
|
|
|
+ 35, 36, 35, 37, 31, 30, 28, 33, 34, 30, 31, 32, 30, 26, 23,
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {},
|
|
|
+ mounted() {
|
|
|
+ this.myChart = this.$echarts.init(this.$refs.testLine);
|
|
|
+ // 获取数据
|
|
|
+
|
|
|
+ this.myChart.setOption(this.option);
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped lang="less">
|
|
|
+.main {
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+.botton1 {
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
+.botton2 {
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
+.name {
|
|
|
+ color: #4adefe;
|
|
|
+ font-size: 20px;
|
|
|
+ display: block;
|
|
|
+}
|
|
|
+.value {
|
|
|
+ display: block;
|
|
|
+ color: white;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|