|
|
@@ -727,6 +727,7 @@ export default {
|
|
|
},
|
|
|
xyList: [],
|
|
|
typesInfo: [],
|
|
|
+ coolingMarkers: [],
|
|
|
typesViewData: {},
|
|
|
breathData: [],
|
|
|
tdList: new Array(42).fill(0),
|
|
|
@@ -1053,6 +1054,7 @@ export default {
|
|
|
getChartData(param).then(res => {
|
|
|
this.rowsInfo = res.rows;
|
|
|
this.typesInfo = res.types;
|
|
|
+ this.coolingMarkers = res.coolingMarkers || [];
|
|
|
this.info.operaDays = res.operaDays;
|
|
|
this.init();
|
|
|
});
|
|
|
@@ -1290,9 +1292,56 @@ export default {
|
|
|
.attr("fill", "#000000");
|
|
|
/* 黑实圆--end */
|
|
|
this.drawx(main, dataset, xScale, yScale);
|
|
|
+ this.drawCoolingMarkers(main, xScale, yScale);
|
|
|
this.initTypes();
|
|
|
// this.hoverEvent(main)
|
|
|
},
|
|
|
+ drawCoolingMarkers(main, xScale, yScale) {
|
|
|
+ if (!this.coolingMarkers || this.coolingMarkers.length === 0) return;
|
|
|
+ const group = {};
|
|
|
+ this.coolingMarkers.forEach(m => {
|
|
|
+ if (!m) return;
|
|
|
+ const idx = Number(m.index);
|
|
|
+ const before = m.before != null ? Number(m.before) : null;
|
|
|
+ const after = m.after != null ? Number(m.after) : null;
|
|
|
+ if (!Number.isFinite(idx) || before === null || after === null) return;
|
|
|
+ if (!group[idx]) group[idx] = [];
|
|
|
+ group[idx].push({ before, after });
|
|
|
+ });
|
|
|
+
|
|
|
+ const step = 2; // 同格多标记时的水平偏移像素
|
|
|
+ Object.keys(group).forEach(k => {
|
|
|
+ const idx = Number(k);
|
|
|
+ const arr = group[k];
|
|
|
+ const n = arr.length;
|
|
|
+ const start = -Math.floor((n - 1) / 2) * step;
|
|
|
+ arr.forEach((m, i) => {
|
|
|
+ const x = xScale(idx) + (n > 1 ? start + i * step : 0);
|
|
|
+ const yTop = yScale(Number(m.before));
|
|
|
+ const yBottom = yScale(Number(m.after));
|
|
|
+ if (!Number.isFinite(yTop) || !Number.isFinite(yBottom)) return;
|
|
|
+ // 竖向红色虚线
|
|
|
+ main
|
|
|
+ .append("line")
|
|
|
+ .attr("x1", x)
|
|
|
+ .attr("y1", yTop)
|
|
|
+ .attr("x2", x)
|
|
|
+ .attr("y2", yBottom)
|
|
|
+ .attr("stroke", "#ff0000")
|
|
|
+ .attr("stroke-width", 1)
|
|
|
+ .attr("stroke-dasharray", "5 5");
|
|
|
+ // 底部小圆圈
|
|
|
+ main
|
|
|
+ .append("circle")
|
|
|
+ .attr("cx", x)
|
|
|
+ .attr("cy", yBottom)
|
|
|
+ .attr("r", 3)
|
|
|
+ .attr("stroke", "#ff0000")
|
|
|
+ .attr("stroke-width", 1)
|
|
|
+ .attr("fill", "none");
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
drawx(main, dataset, xScale, yScale) {
|
|
|
/* 【叉形】--start */
|
|
|
main
|