|
@@ -37,10 +37,8 @@
|
|
v-loading="loading"
|
|
v-loading="loading"
|
|
:id="`plotly-3d-chart-` + index"
|
|
:id="`plotly-3d-chart-` + index"
|
|
ref="plotlyChart"
|
|
ref="plotlyChart"
|
|
- style="height: 600px"
|
|
|
|
- >
|
|
|
|
- <el-empty v-if="isError" description="请求失败"></el-empty>
|
|
|
|
- </div>
|
|
|
|
|
|
+ style="height: 500px; background-color: #e5ecf6"
|
|
|
|
+ ></div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -236,6 +234,7 @@ export default {
|
|
},
|
|
},
|
|
plot_bgcolor: "#e5ecf6",
|
|
plot_bgcolor: "#e5ecf6",
|
|
gridcolor: "#fff",
|
|
gridcolor: "#fff",
|
|
|
|
+ backgroundcolor: "#e5ecf6", // 设置背景颜色为白色
|
|
// camera: {
|
|
// camera: {
|
|
// center: { x: 0, y: 0, z: 0 },
|
|
// center: { x: 0, y: 0, z: 0 },
|
|
// eye: { x: 0, y: 0, z: 2.5 },
|
|
// eye: { x: 0, y: 0, z: 2.5 },
|
|
@@ -281,6 +280,16 @@ export default {
|
|
}
|
|
}
|
|
console.log(zChartSetUp, yChartSetUp, xChartSetUp, "xChartSetUp");
|
|
console.log(zChartSetUp, yChartSetUp, xChartSetUp, "xChartSetUp");
|
|
Plotly.newPlot(`plotly-3d-chart-` + this.index, traces, layout);
|
|
Plotly.newPlot(`plotly-3d-chart-` + this.index, traces, layout);
|
|
|
|
+ plotElement.on("plotly-3d-chart-", function (eventData) {
|
|
|
|
+ // 在每次布局变更时,打印当前相机视角
|
|
|
|
+ if (eventData["scene.camera"]) {
|
|
|
|
+ console.log(
|
|
|
|
+ "当前相机视角:",
|
|
|
|
+ eventData["scene.camera"],
|
|
|
|
+ eventData["scene.aspectratio"]
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
updateChartColor() {
|
|
updateChartColor() {
|
|
@@ -313,4 +322,11 @@ export default {
|
|
::v-deep canvas {
|
|
::v-deep canvas {
|
|
/* height: 400px !important; */
|
|
/* height: 400px !important; */
|
|
}
|
|
}
|
|
|
|
+.js-plotly-plot .plotly,
|
|
|
|
+.js-plotly-plot .plotly div {
|
|
|
|
+ background: #e5ecf6 !important;
|
|
|
|
+}
|
|
|
|
+#scene {
|
|
|
|
+ background: #e5ecf6 !important;
|
|
|
|
+}
|
|
</style>
|
|
</style>
|