Browse Source

更改

wangqin
zhangzhang 8 months ago
parent
commit
76d24ad970
  1. 98
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/index.vue

98
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/index.vue

@ -28,33 +28,33 @@ import * as echarts from "echarts";
import chartsStatistics from "./assets/charts";
import { getWarningTypeDay } from "../../../../../../../api/event/perceiveEvent";
const drawRoundRect = (ctx, x, y, width, height, radius, gr) => {
// ctx, x, y, , ,
ctx.beginPath();
ctx.fillStyle = gr;
ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2);
ctx.lineTo(width - radius + x, y);
ctx.arc(
width - radius + x,
radius + y,
radius,
(Math.PI * 3) / 2,
Math.PI * 2
);
ctx.lineTo(width + x, height + y - radius);
ctx.arc(
width - radius + x,
height - radius + y,
radius,
0,
(Math.PI * 1) / 2
);
ctx.lineTo(radius + x, height + y);
ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI);
ctx.closePath();
//ctx.stroke();
ctx.fill();
};
// const drawRoundRect = (ctx, x, y, width, height, radius, gr) => {
// // ctx, x, y, , ,
// ctx.beginPath();
// ctx.fillStyle = gr;
// ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2);
// ctx.lineTo(width - radius + x, y);
// ctx.arc(
// width - radius + x,
// radius + y,
// radius,
// (Math.PI * 3) / 2,
// Math.PI * 2
// );
// ctx.lineTo(width + x, height + y - radius);
// ctx.arc(
// width - radius + x,
// height - radius + y,
// radius,
// 0,
// (Math.PI * 1) / 2
// );
// ctx.lineTo(radius + x, height + y);
// ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI);
// ctx.closePath();
// //ctx.stroke();
// ctx.fill();
// };
export default {
name: "TypeAnalysis",
@ -187,29 +187,29 @@ export default {
myChart.setOption(chartsStatistics);
});
const domMap = document.getElementById("typeAnalysis");
let parentDiv = domMap.firstChild;
// canvas
let canvas = document.createElement("canvas");
canvas.width = parentDiv.offsetWidth;
canvas.height = parentDiv.offsetHeight;
parentDiv.appendChild(canvas);
const context = canvas.getContext("2d");
// const domMap = document.getElementById("typeAnalysis");
// let parentDiv = domMap.firstChild;
// // canvas
// let canvas = document.createElement("canvas");
// canvas.width = parentDiv.offsetWidth;
// canvas.height = parentDiv.offsetHeight;
// parentDiv.appendChild(canvas);
// const context = canvas.getContext("2d");
//
var gr = context.createLinearGradient(230, 0, 360, 0);
//
gr.addColorStop(1, "rgba(92,197,255,0)");
gr.addColorStop(0, "rgba(92,197,255,0.5)");
// //
// var gr = context.createLinearGradient(230, 0, 360, 0);
// //
// gr.addColorStop(1, "rgba(92,197,255,0)");
// gr.addColorStop(0, "rgba(92,197,255,0.5)");
context.lineWidth = 1; // 线
// context.lineWidth = 1; // 线
//
drawRoundRect(context, 228, 8, 280, 24, 12, gr);
drawRoundRect(context, 228, 36, 280, 24, 12, gr);
drawRoundRect(context, 228, 64, 280, 24, 12, gr);
drawRoundRect(context, 228, 92, 280, 24, 12, gr);
drawRoundRect(context, 228, 120, 280, 24, 12, gr);
// //
// drawRoundRect(context, 228, 8, 280, 24, 12, gr);
// drawRoundRect(context, 228, 36, 280, 24, 12, gr);
// drawRoundRect(context, 228, 64, 280, 24, 12, gr);
// drawRoundRect(context, 228, 92, 280, 24, 12, gr);
// drawRoundRect(context, 228, 120, 280, 24, 12, gr);
});
});
},
@ -289,7 +289,7 @@ export default {
.legend-name {
width: 60px;
margin-left: 10px;
font-size: 14px;
font-size: 12px;
}
.legend-num,
.legend-percert {
@ -297,7 +297,7 @@ export default {
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
font-size: 12px;
color: #37e7ff;
font-weight: bold;
}

Loading…
Cancel
Save