|
@@ -1,7 +1,7 @@
|
|
|
<!--
|
|
|
* @Author: your name
|
|
|
* @Date: 2024-09-11 14:32:12
|
|
|
- * @LastEditTime: 2025-02-26 15:01:26
|
|
|
+ * @LastEditTime: 2025-02-26 15:47:01
|
|
|
* @LastEditors: bogon
|
|
|
* @Description: In User Settings Edit
|
|
|
* @FilePath: /performance-test/src/views/performance/components/chartsCom/powerMarkers2DCharts.vue
|
|
@@ -345,7 +345,6 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
handleSelectClick(gd) {
|
|
|
// 绑定 plotly_click 事件
|
|
|
gd.on("plotly_click", (data) => {
|
|
@@ -417,11 +416,29 @@ export default {
|
|
|
"marker.size": [newSize],
|
|
|
});
|
|
|
|
|
|
+ // 确保选中的点在最上面
|
|
|
+ const scatterTrace = gd.data[0]; // 原来的散点数据
|
|
|
+ const selectedTrace = {
|
|
|
+ x: this.selectedPoints.map((p) => p.x),
|
|
|
+ y: this.selectedPoints.map((p) => p.y),
|
|
|
+ mode: "markers",
|
|
|
+ type: "scattergl",
|
|
|
+ marker: {
|
|
|
+ color: "red", // 选中点颜色
|
|
|
+ size: 10,
|
|
|
+ },
|
|
|
+ };
|
|
|
+
|
|
|
+ // 合并数据,并保证选中点在最后
|
|
|
+ const updatedTraces = [scatterTrace, selectedTrace]; // 选中的点 `selectedTrace` 放在最后
|
|
|
+
|
|
|
+ // 更新图表
|
|
|
+ Plotly.react(gd, updatedTraces, gd.layout);
|
|
|
+
|
|
|
// 处理选中的数据
|
|
|
this.getSelectData(this.selectedPoints, gd.layout);
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
handleClearSelect(gd) {
|
|
|
this.selectedPoints = [];
|
|
|
Plotly.restyle(gd, {
|